Using JDBC ? Style Parameters and Oracle Style :param on view objects

can i use :0 style on predicate side of a sql statement
example
===========================================================
select nvl(:0, null) from dual
===========================================================
After some test for me only work using ? style.
The ? style cause me problem on my already creaded master details view objects
Any help on this
Best Regards

Frank tnx for repply
My problems is , when i use parameters on functions like decode
===================================================
SELECT decode(:0,'VALOR1', 'VALOR1','SINVALOR') VALOR,
       Dept.DEPTNO,
FROM DEPT Dept
and
SELECT decode(:0,'VALOR1', 'VALOR1','SINVALOR') VALOR,
       Emp.EMPNO,
       Emp.DEPTNO
FROM EMP Emp===================================================
on a view object that is detail view object (departments vo -> employees vo)
and have a view link EmpsByDeptViewLink
the parameter of my view link SQL dont work (in my case :1) <-param of SQL view link
In my vo :0 is my first parameter, :1 of my view link is my second parameter,
but when i access my EmpsByDept.do ADF page and set
    ViewObject vo = getDeptView1();
    vo.setWhereClause("DEPTNO = :0");
    vo.setWhereClauseParam(0,"VALOR2");
    vo.setWhereClauseParam(1,"10");
    vo.executeQuery();
    ViewObject vo1 = getEmpView1();
    vo1.setWhereClause("EMPNO = :1");
    vo1.setWhereClauseParam(0,"VALOR1");
    vo1.executeQuery();its doesnot work.
I need to do some aditional steps to parameter of my view link SQL work?
Also i has uploaded a TestCase on http://www.geocities.com/mroseroc/ScottADFTest.zip
Errors from my Jdeveloper Debug level are:
=======================================================
SELECT * FROM (SELECT decode(:0,'VALOR1', 'VALOR1','SINVALOR') VALOR,
       Emp.EMPNO,
       Emp.ENAME,
       Emp.JOB,
       Emp.MGR,
       Emp.HIREDATE,
       Emp.SAL,
       Emp.COMM,
       Emp.DEPTNO
FROM EMP Emp) QRSLT  WHERE (EMPNO = :1)
06/04/26 21:55:03 [915] Bind params for ViewObject: EmpView1
06/04/26 21:55:03 [916] Binding param 1: VALOR1
06/04/26 21:55:03 [917] ViewObject: EmpView1 close single-use prepared tatements
06/04/26 21:55:03 [918] QueryCollection.executeQuery failed...
06/04/26 21:55:03 [919] java.sql.SQLException: Missing parameter IN o OUT on index:: 2=======================================================
(EMPNO = :1) <- this value is never passed

Similar Messages

  • Use ? style Parameter for View Object

    I'm guess that if you set the ViewObject to use ? style parameter. You have to use the whereclause to pass in the parameter, correct? If so then how do you pass in parameter (use input) to the whereclause in a jsp page?

    Never mind I was trying to set the whereclause in the tag, whereclause="application_id=<%=appId%>".

  • Help building an e-commerce site using DreamWeaver MX 2004 and Oracle 10G

    I'm new to using Oracle 10G. After reviewing several rdms's I've picked Oracle 10G as my rdms. I'm trying to build an ecommerce site using DreamWeaver MX 2004 and Oracle 10G. The website will be selling hardware and software products. I have a choice in DreamWeaver to go for a .asp or .jsp setup. I have several questions, here goes:
    1. Is there any book/tutorial/whitepaper out there that describes building an ecommerce site using Oracle 10G/9I/8I? Just some examples as how to make the datamodel regarding the shopping basket etc.
    2. I prefer DreamWeaver as it let's me make nice looking css style based pages without throttling too much through the code. Are there Oracle tools which allow me to make an advanced nice looking ecommerce site?
    I hope some of you can help me get started. Any effort is appreciated.
    Cheers

    I'm new to using Oracle 10G. After reviewing several rdms's I've picked Oracle 10G as my rdms. I'm trying to build an ecommerce site using DreamWeaver MX 2004 and Oracle 10G. The website will be selling hardware and software products. I have a choice in DreamWeaver to go for a .asp or .jsp setup. I have several questions, here goes:
    1. Is there any book/tutorial/whitepaper out there that describes building an ecommerce site using Oracle 10G/9I/8I? Just some examples as how to make the datamodel regarding the shopping basket etc.
    2. I prefer DreamWeaver as it let's me make nice looking css style based pages without throttling too much through the code. Are there Oracle tools which allow me to make an advanced nice looking ecommerce site?
    I hope some of you can help me get started. Any effort is appreciated.
    Cheers

  • Returning arrays using JDBC 2.0 and JDK 1.2.2

    I am able to return a varray from an PL/SQL stored procedure to a Java program using the Oracle JDBC 8.1.6 driver classes (oracle.jdbc.driver.* and oracle.sql.ARRAY). I want to avoid using the Oracle specific classes to do this and instead just use the standard JDBC 2.0 classes and JDK 1.2.2. Will I still be able to access the varray returned by the PL/SQL SP or am I forced to use the Oracle classes?
    Why I ask this is because the Java code needs to be usable from a Netscape Application Server 4.0/iPlanet Application Server 6.0 servlet or java class. NAS 4.0 uses the JDBC 2.0 classes but I cannot use the Oracle JDBC 8.1.6 classes since NAS 4.0 requires the Oracle 8.0.5 client. iAS 6.0 provides a JDBC 2.0 type 2 driver and uses the Oracle 8.1.5 client but does not support arrays, i.e. CallableStatement.getArray(), ResultSet.getArray(), etc. are not supported.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Craig Knelsen ([email protected]):
    I am able to return a varray from an PL/SQL stored procedure to a Java program using the Oracle JDBC 8.1.6 driver classes (oracle.jdbc.driver.* and oracle.sql.ARRAY). I want to avoid using the Oracle specific classes to do this and instead just use the standard JDBC 2.0 classes and JDK 1.2.2. Will I still be able to access the varray returned by the PL/SQL SP or am I forced to use the Oracle classes?
    Why I ask this is because the Java code needs to be usable from a Netscape Application Server 4.0/iPlanet Application Server 6.0 servlet or java class. NAS 4.0 uses the JDBC 2.0 classes but I cannot use the Oracle JDBC 8.1.6 classes since NAS 4.0 requires the Oracle 8.0.5 client. iAS 6.0 provides a JDBC 2.0 type 2 driver and uses the Oracle 8.1.5 client but does not support arrays, i.e. CallableStatement.getArray(), ResultSet.getArray(), etc. are not supported.<HR></BLOCKQUOTE>
    can u plzz help me as to how u returned the
    null

  • Out of memory using Windows Server 2003 and Oracle 9.2.0.3

    Hi,
    I just installed both Windows Server 2003 and Oracle 9.2.0.3. The server I am using has 4 gigabytes of memory installed, and windows shows that to be the actual physical memory on the server. The paging file is 8 gigabytes for a total of 12 gigabytes of virtual memory.
    Using the Oracle Database Configuration Assistant, I create a new database using default values. After verifying the installation worked OK (database started, queries ran), I attempted to change some of the memory parameters and was able to start the database using about 1.4 gigabytes of total SGA, with the O/S using about .3 gigabytes for a total of 1.7 gigabytes. I then attempted to change the buffer cache + 1 gigabyte for a total of 2 gigabytes. Now the database will not start and I get an out of memory error ora-27102 with an additional O/S memory error of "O/S Error: (OS 8) Not enough storage is available to process this command".
    So, I have two problems:
    1) With 4 gigabytes installed, and the O/S using only about 300 megabytes, why isn't Oracle able to take advantage of the memory on this machine past the 1.7 gigabytes (as reported by Windows task manager).
    2) How do I change the spfile memory parameters so the database will start using spfile? I can start the database pointing to a pfile with lesser memory parameters, but I don't know how to effect change on the spfile, since I cannot start with the spfile.
    Both these technologies (9.2.0.3 and Server 2003) are new to me, so any insight would be appreciated!
    HERE ARE THE SPFILE PARAMETERS THAT WORKED:
    SGA (M)
    Shared Pool=104
    Buffer Cache=960 ***
    Large Pool=0
    Java Pool=64
    Total SGA=1128
    SGA Max Size=1321
    Aggregate PGA Target=1500
    Current PGA Allocated=22868KB
    WINDOWS MEMORY INFO FROM TASK MANAGER SHOW:
    PF Usage=1.66GB
    Physical Memory (K)
    Total=4062704
    Available=3203460
    System Cache=2499096
    Commit Charge (K)
    Total=1748184
    Limit=12288628
    Peak=1925276
    *** When I change this to 2048 the database did not start.
    Thank you.

    CREATE SPFILE
    Purpose
    Use the CREATE SPFILE statement to create a server parameter file from a client-side initialization parameter file. Server parameter files are binary files that exist only on the server and are called from client locations to start up the database.
    Server parameter files let you make persistent changes to individual parameters. When you use a server parameter file, you can specify in an ALTER SYSTEM SET parameter statement that the new parameter value should be persistent. This means that the new value applies not only in the current instance, but also to any instances that are started up subsequently. Traditional client-side parameter files do not let you make persistent changes to parameter values. Because they are located on the server, these files allow for automatic database tuning by Oracle and for backup by Recovery Manager (RMAN).
    To use a server parameter file when starting up the database, you must create it from a traditional text initialization parameter file using the CREATE SPFILE statement.
    All instances in an Real Application Clusters environment must use the same server parameter file. However, when otherwise permitted, individual instances can have different settings of the same parameter within this one file. Instance-specific parameter definitions are specified as SID.parameter = value, where SID is the instance identifier.
    The method of starting up the database with a server parameter file depends on whether you create a default or nondefault server parameter file. Please refer to "Creating a Server Parameter File: Examples" for examples of how to use server parameter files.
    See Also:
    CREATE PFILE for information on creating a regular text parameter file from a binary server parameter file
    Oracle9i Database Administrator's Guide for information on pre-Oracle9i initialization parameter files and Oracle9i server parameter files
    Oracle9i Real Application Clusters Administration for information on using server parameter files in a Real Application Clusters environment
    Prerequisites
    You must have the SYSDBA or the SYSOPER system privilege to execute this statement. You can execute this statement before or after instance startup. However, if you have already started an instance using spfile_name, you cannot specify the same spfile_name in this statement.
    Syntax
    create_spfile::=
    Text description of create_spfile
    Semantics
    spfile_name
    This clause lets you specify a name for the server parameter file you are creating.
    If you do not specify spfile_name, Oracle uses the platform-specific default server parameter filename. If spfile_name already exists on the server, this statement will overwrite it. When using a default server parameter file, you start up the database without referring to the file by name.
    If you do specify spfile_name, you are creating a nondefault server parameter file. In this case, to start up the database, you must first create a single-line traditional parameter file that points to the server parameter file, and then name the single-line file in your STARTUP command.
    See Also:
    "Creating a Server Parameter File: Examples" for information on starting up the database with default and nondefault server parameter files
    Oracle9i Database Administrator's Guide for Windows (or other appropriate operating system specific documentation) for default parameter file names
    pfile_name
    Specify the traditional initialization parameter file from which you want to create a server parameter file.
    If you specify pfile_name, the parameter file must reside on the server. If it does not reside in the default directory for parameter files on your operating system, you must specify the full path.
    If you do not specify pfile_name, Oracle looks in the default directory for parameter files on your operating system for the default parameter filename, and uses that file. If that file does not exist in the expected directory, Oracle returns an error.
    Note:
    In a Real Application Clusters environment, you must first combine all instance parameter files into one file before specifying it in this statement to create a server parameter file. For information on accomplishing this step, see Oracle9i Real Application Clusters Setup and Configuration.
    Examples
    Creating a Server Parameter File: Examples
    The following example creates a default server parameter file from a client initialization parameter file named t_init1.ora:
    CREATE SPFILE
    FROM PFILE = '$ORACLE_HOME/work/t_init1.ora';
    Note:
    Typically you will need to specify the full path and filename for parameter files on your operating system. Please refer to your Oracle operating system documentation for path information.
    When you create a default server parameter file, you subsequently start up the database using that server parameter file by using the SQL*Plus command STARTUP without the PFILE parameter, as follows:
    STARTUP
    The following example creates a nondefault server parameter file s_params.ora from a client initialization file named t_init1.ora:
    CREATE SPFILE = 's_params.ora'
    FROM PFILE = '$ORACLE_HOME/work/t_init1.ora';
    When you create a nondefault server parameter file, you subsequently start up the database by first creating a traditional parameter file containing the following single line:
    spfile = 's_params.ora'
    The name of this parameter file must comply with the naming conventions of your operating system. You then use the single-line parameter file in the STARTUP command. The following example shows how to start up the database, assuming that the single-line parameter file is named new_param.ora:
    STARTUP PFILE=new_param.ora
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_616a.htm#SQLRF01315
    Joel P�rez

  • Help!.... XA error: using Weblogic 6.1 and Oracle 8.1.6

              Hi,
              I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSource as I wanted
              to use Container Managed Transaction through a Session Bean.
              Connection Pool Settings: -------------------------
              Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
              TXDataSource Settings : -----------------------
              Name - myXADS
              JNDIName - myXADS
              PoolName - myXAPool
              Everything works fine but once in a while I get the following exception:
              java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured
              in the transaction branch start() failed on resource 'myXAPool' Unexpected error
              during start for XAResource 'myXAPool': null
              The connection pool size is 30 and the number connections high reached was 5,
              which means there are enough connections in the pool available at all time.
              It would be really great if you can help me out.
              Thanks in Advance, Sudhir.
              

    Hi Slava,
    Sorry about that Oracle instance I am using is 8.1.7.
    For the XA Driver I am using the one that comes with Weblogic in weblogic.jar.
    And my Weblogic version 6.1 Sp3.
    Thanks,
    Sudhir.
    "Slava Imeshev" <[email protected]> wrote:
    Hi Sudhir,
    Are you using an instance of 8.1.6 or 8.1.7? In the message header you
    say
    8.1.6.
    Regards,
    Slava Imeshev
    "Sudhir Babu" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSourceas
    I wanted
    to use Container Managed Transaction through a Session Bean.
    Connection Pool Settings: -------------------------
    Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb
    DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
    TXDataSource Settings : -----------------------
    Name - myXADS
    JNDIName - myXADS
    PoolName - myXAPool
    Everything works fine but once in a while I get the following exception:
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager errorhas
    occured
    in the transaction branch start() failed on resource 'myXAPool' Unexpectederror
    during start for XAResource 'myXAPool': null
    The connection pool size is 30 and the number connections high reachedwas
    5,
    which means there are enough connections in the pool available at alltime.
    It would be really great if you can help me out.
    Thanks in Advance, Sudhir.

  • XA error: using Weblogic 6.1 and Oracle 8.1.6

    Hi,
    I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSource as I wanted
    to use Container Managed Transaction through a Session Bean.
    Connection Pool Settings: -------------------------
    Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb
    DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
    TXDataSource Settings : -----------------------
    Name - myXADS
    JNDIName - myXADS
    PoolName - myXAPool
    Everything works fine but once in a while I get the following exception:
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured
    in the transaction branch start() failed on resource 'myXAPool' Unexpected error
    during start for XAResource 'myXAPool': null
    The connection pool size is 30 and the number connections high reached was 5,
    which means there are enough connections in the pool available at all time.
    It would be really great if you can help me out.
    Thanks in Advance, Sudhir.

    Hi Slava,
    Sorry about that Oracle instance I am using is 8.1.7.
    For the XA Driver I am using the one that comes with Weblogic in weblogic.jar.
    And my Weblogic version 6.1 Sp3.
    Thanks,
    Sudhir.
    "Slava Imeshev" <[email protected]> wrote:
    Hi Sudhir,
    Are you using an instance of 8.1.6 or 8.1.7? In the message header you
    say
    8.1.6.
    Regards,
    Slava Imeshev
    "Sudhir Babu" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I am using Weblogic 6.1 with Oracle 8.1.7. I configured a TXDataSourceas
    I wanted
    to use Container Managed Transaction through a Session Bean.
    Connection Pool Settings: -------------------------
    Name - myXAPool URL - jdbc:oracle:thin:@myServer:1521:myDb
    DriverClassname - oracle.jdbc.xa.client.OracleXADataSource
    TXDataSource Settings : -----------------------
    Name - myXADS
    JNDIName - myXADS
    PoolName - myXAPool
    Everything works fine but once in a while I get the following exception:
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager errorhas
    occured
    in the transaction branch start() failed on resource 'myXAPool' Unexpectederror
    during start for XAResource 'myXAPool': null
    The connection pool size is 30 and the number connections high reachedwas
    5,
    which means there are enough connections in the pool available at alltime.
    It would be really great if you can help me out.
    Thanks in Advance, Sudhir.

  • Using J2EE EJB Container and Oracle 8.1.7

    I am trying to setup the J2EE EJB container to use and Oracle 8.1.7 database instead of Cloudscape. So far I have done the following
    0. Created the table for the Savings Account tutorial in the Oracle Database.
    1. Added the Classes12.jar (Oracle's latest JDBC thin drivers) to my CLASSPATH
    2. Under "Server Configuration" I added the standard/jdbc drivers value: "oracle.jdbc.driver.OracleDriver".
    3. Under "Server Configuration" I added the standard/datasource value: JNDI name "jdbc/Oracle" and JDBC URL "jdbc:oracle:thin:@10.1.1.254:1521:DEV".
    4. For the savings account tutorial, when deploying I specified "jdbc/Oracle" for the reference "jdbc/SavingsAccountDB".
    I have gotten this tutorial to work using the Cloudscape database. After I did the previous steps and tried to run the client, I get no valid driver available, unable to connect to Oracle.
    What else to I need to do?
    My setup is:
    Windows 2000 Professional
    J2EE (JDK 1.3.1)
    Oracle 8.1.7
    Thank you in advance.

    Exactly which classpath did you add the Oracle JDBC library jar to ?
    The thing that works for me is to have the following line in the file %J2EE_HOME%\bin\userconfig.bat
    set J2EE_CLASSPATH=D:\DownLoad\Oracle\classes12_01.zip;

  • How to connect using netbean 6.5 and oracle lite 10g

    Hello everyone.. I am really really new in this kind of thing. My task is that I need to develop a simple system using netbean and oracle lite 10g..Does anyone can at least give me a little bit tutorial for a head start in order to connect them.. I really appreciate for those who answer this.. Thank you guys...

    you mean to connect from java to oracle lite server or client?
    -if it is server you mean then you probably need to run some oracle apis (e.g. the consolidator aps).
    String url="MOBILEADMIN/123@jdbc:oracle:thin:@MYSERVER:1521:MYDB" ;
    ResourceManager.initialize(url);
    rm = ResourceManager.getInstance();
    User usr = rm.getUser(user);
    for (Enumeration e = usr.getDevices(); e.hasMoreElements();) {
    Device dev = (Device)e.nextElement();
    }//AND you may continue from here in order to send commands to the devices
    -if you have a oracle repository at the back end and you want to connect to that then you can connect like:
    DriverManager.registerDriver ((Driver)Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance ());
    String url="jdbc:oracle:thin:@myserver:port:database;
    c=DriverManager.getConnection( url,"username", "password" );
    s=c.createStatement();
    s.executeQuery("Select TRIM(CODES) AS CODES,TRIM(SURNAME)||'_'||TRIM(FIRSTNAME) AS NAME from MYDB.USERS");
    ResultSet rs =s.getResultSet();
    -now if you want to connect to the oracle lite client database then you may connect using the polite
    you should write something like (i havent tried it because i use handheld clients)
    String ConnectMe=("jdbc:polite:SCOTT/tiger:polite;DataDirectory=c:\Oracle_Home;Database=polite;IsolationLevel=SINGLE;USER;Autocommit=ON;CursorType=DYNAMIC")
    try {
    Connection conn = DriverManager.getConnection(ConnectMe)
    catch (SQLException e)
    (check the internet for jdbc:polite connection strings)
    gl

  • JDBC Thin Client and Oracle Long Datatype

    I am using Wepshere 4.0.2 , JDBC 2.0 (thin driver) and oracle 9i.
    I have a procedure which takes Oracle Long Datatype as its parameter.
    I use following code to execute procedure.
    String dataforsql="AAA000000003 123123 07/01/200301/01/2003";
    byte[] bytes = dataforsql.getBytes();
    InputStream is = new ByteArrayInputStream(bytes);
    cstmt=conn.prepareCall("call nscw.CPPF_SAVEPDCRAWTABLE2(?,?,?)");
    cstmt.setAsciiStream (1, is,bytes.length);
    The above code works perfectly for data upto 4000 bytes. Once the data crosses the 4000 mark.
    i get a procedure error
    ORA-01460: unimplemented or unreasonable conversion requested

    cstmt.setAsciiStream (1, is,bytes.length);Oracle's support for CLOB (and BLOB) columns using set{Ascii,Binary}Stream() generally s*cks. You'll have to read Oracle's own JDBC manual (you can read it online at http://technet.oracle.com) for whatever sequence they recommend.
    E.g. for insertion and updation of CLOBS, you're supposed to use an oracle-specific function (EMPTY_CLOB()) as the value in the INSERT/UPDATE statement, and then do a SELECT, getClob(), and use Clob APIs to update the actual column value. At least officially. Or you have to use some Oracle-specific APIs in oracle.sql.Connection and oracle.sql.CLOB.

  • Trying to use 3 input parameters and getting errors

    The code I am using was modified from code that worked using one parameter. Below is the code. I don't have a problem until I go to add values to the collection object. Then those 3 lines error, which I think also causes the next 3 lines to error.
    Does anybody know how to fix this?
    /* EmailPO.java - Created on 10-06-2010 John Carrott
    Stored at C:\Documents and Settings\jcarrott\workspace
                \checkReg\src\ 
    First-
    This program opens and reads the file CReg.txt, which contains;
    *     1. Cash code
    *     2. Bank code
    *     3. Trans Ident number
    4. Vendor number
    5. Check Number
    Second -
      Open CeckRegister.rpt using 3 parameters Cahs_code, Bank_code, and
    Trans_Ident, then export as (filename).pdf. Where (filename) is
    Vendor_number plus today's date plus the check number. These 3 fields
    are separated by '_' to make the name readable.
    Loop until CReg.txt is empty
    Lawson tables read by Crystal Report:
         1. CBCHECK
         2. APPAYMENT
         3. APINVOICE
         4. APVENMAST
         5. APVENADDR
    //Java Imports.
    import java.io.BufferedReader;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStreamReader;
    import java.text.SimpleDateFormat;
    import javax.swing.SwingUtilities;
    import com.businessobjects12.prompting.objectmodel.common.IValue;
    import com.businessobjects12.prompting.objectmodel.common.Values;
    import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument;
    import com.crystaldecisions.sdk.occa.report.data.Fields;
    import com.crystaldecisions.sdk.occa.report.data.ParameterField;
    import com.crystaldecisions.sdk.occa.report.data.ParameterFieldDiscreteValue;
    import com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat;
    import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;
    public class checkReg {
              private static final String REPORT_NAME = "D:
    Inetpub
    ftproot
    CRegister
    CheckRegister.rpt";
              public static void launchApplication() {
              try
                   File f1 = new File("D:
    Inetpub
    ftproot
    CRegister
    CReg.jac");
                   if (f1.exists())
                   {f1.delete();
              java.io.File src = new File("D:
    Inetpub
    ftproot
    CRegister
    CReg.txt");
              java.io.File dest = new File("D:
    Inetpub
    ftproot
    CRegister
    CReg.txt".replace(".txt", ".jac"));
              src.renameTo(dest);
              File f2 = new File("D:
    Inetpub
    ftproot
    CRegister
    CReg.bak");
              if (f2.exists())
                   {f2.delete();
                   FileInputStream in = new FileInputStream("D:
    Inetpub
    ftproot
    CRegister
    CReg.jac");
                   BufferedReader br = new BufferedReader(new InputStreamReader(in));
                   String strLine;
                   String sDate;
                   SimpleDateFormat formatter = new SimpleDateFormat("MMddyyyy");
                   java.util.Date date = new java.util.Date();
         // to run for the current day use this -       
                   sDate = formatter.format(date);
         //Create a Fields collection object to store the parameter fields in.
                   Fields parameterFields = new Fields();
         //Create a ParameterField object for each field that you wish to set.
                   ParameterField pfield1 = new ParameterField();
                   ParameterField pfield2 = new ParameterField();
                   ParameterField pfield3 = new ParameterField();
         //Create a Values object and a ParameterFieldDiscreteValue object for each parameter field you wish to set.
         //If a ranged value is being set, a ParameterFieldRangeValue object should be used instead of the discrete value object.
                        Values vals1 = new Values();
                        Values vals2 = new Values();
                        Values vals3 = new Values();
                        ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue();
                        ParameterFieldDiscreteValue pfieldDV2 = new ParameterFieldDiscreteValue();
                        ParameterFieldDiscreteValue pfieldDV3 = new ParameterFieldDiscreteValue();
                        pfield1.setName("cash_code");
                        pfield2.setName("bank_code");
                        pfield3.setName("tran_code");
         // Read the file one line at a time
                 while ((strLine = br.readLine()) != null)  
                      String patternStr = ",";
                     String[] args = strLine.split(patternStr);
        // format is vendor_yyyymmdd_check_nbr.pdf
                     String EXPORT_FILE = "D:
    Appdata
    CRegister
    " + args[3] + "_" + sDate + "_" + args[4] + ".pdf";
                   try {
         //Open report.
                        ReportClientDocument reportClientDoc = new ReportClientDocument();
                        reportClientDoc.open(REPORT_NAME, 0);
         //We will be using the ParameterFieldController quite a bit through-out the rest of this function.
                        reportClientDoc.getDatabaseController().logon("test","test");
         //Set parameters.
                        pfieldDV1.setValue(new String(args[0]));
                        pfieldDV2.setValue(new String(args[1]));
                        pfieldDV3.setValue(new String(args[2]));
         //Add the parameter field values to the Values collection object.
         // Error : The method add(IValue) in the type ArrayList<IValue> is not applicable for the arguments
         //         (ParameterFieldDiscreteValue)
                        vals1.add(pfieldDV1);
                        vals2.add(pfieldDV2);
                        vals3.add(pfieldDV3);
         //Set the current Values collection for each parameter field.
         // Error : The method setCurrentValues(Values) in the type ParameterField is not applicable for the
         //         arguments (Values)
                        pfield1.setCurrentValues(vals1);
                        pfield2.setCurrentValues(vals2);
                        pfield3.setCurrentValues(vals3);
         //Add each parameter field to the Fields collection.
         //The Fields object is now ready to be used with the viewer.
                        parameterFields.add(pfield1);
                        parameterFields.add(pfield2);
                        parameterFields.add(pfield3);
                        ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
         //Release report.
                        reportClientDoc.close();
         //Use the Java I/O libraries to write the exported content to the file system.
                        byte byteArray[] = new byte[byteArrayInputStream.available()];
         //Create a new file that will contain the exported result.
                        File file = new File(EXPORT_FILE);
                        FileOutputStream fileOutputStream = new FileOutputStream(file);
                        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(byteArrayInputStream.available());
                        int x = byteArrayInputStream.read(byteArray, 0, byteArrayInputStream.available());
                        byteArrayOutputStream.write(byteArray, 0, x);
                        byteArrayOutputStream.writeTo(fileOutputStream);
         //Close streams.
                        byteArrayInputStream.close();
                        byteArrayOutputStream.close();
                        fileOutputStream.close();
                        System.out.println("Successfully exported report to " + EXPORT_FILE);
                   catch(ReportSDKException ex) {
                        ex.printStackTrace();
                  System.out.println("The exporting of reports has finished!");
                   br.close();
                   in.close();
                   java.io.File src2 = new File("D:
    Inetpub
    ftproot
    CRegister
    CReg.jac");
                   java.io.File dest2 = new File("D:
    Inetpub
    ftproot
    CRegister
    CReg.jac".replace(".jac", ".bak"));
                   catch(Exception ex) {
                        System.out.println(ex);               
              private static Object String(String string) {
                   // TODO Auto-generated method stub
                   return null;
              public static void main(String [] args) {
                   SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                             //Hand-off to worker function to start application.
                             launchApplication();

    That did not get any errors, but it did not return any data in the report.
    I think that this is loading one value on top of another, so at the end only the last parameter is loaded.
    This is what I have now for code.
    //Open report.
         ReportClientDocument reportClientDoc = new ReportClientDocument();
         reportClientDoc.open(REPORT_NAME, 0);
    //We will be using the ParameterFieldController quite a bit through-out the rest of this function.
         reportClientDoc.getDatabaseController().logon("procure","procure90");
         com.crystaldecisions.sdk.occa.report.application.ParameterFieldController paramFieldController =            reportClientDoc.getDataDefController().getParameterFieldController();
         paramFieldController.setCurrentValue("", "cash_code", new String(args[0]));
         paramFieldController.setCurrentValue("", "bank_code", new String(args[1]));
         paramFieldController.setCurrentValue("", "tran_code", new String(args[2]));
         ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
    //Release report.
         reportClientDoc.close();
    Does anybody have any ideas on how to load 3 parameters?

  • Anyone successfully using WL 6.0 and oracle.jdbc.xa.client.OracleXADataSource?

    My final goal is to have two xa pools pointing to different db's and
    have them in the same user transaction and do a 2 phase commit. I
    can't get past connecting to a single xa datasource. I have "Grant
    Select on DBA_PENDING_TRANSACTIONS to public".
    My config.xml snippet:
    <JDBCConnectionPool
    Name="ModelXaPool"
    Targets="WebApp"
    URL="jdbc:oracle:thin:@SERVER1:1521:DB"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="2"
    MaxCapacity="10"
    CapacityIncrement="2"
    Properties="user=uid;password=pw"
    RefreshMinutes="10"
    />
    <JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="ModelManagerTxDataSource"
    Name="ModelManagerTxDataSource"
    PoolName="ModelManagerXaPool"
    Targets="WebWORKS"
    />
    My code snippet:
    UserTransaction tx = msgCtx.getUserTransaction();
    tx.begin();
    java.sql.Connection conn =
    (DataSource)ctx.lookup("ModelManagerTxDataSource")).getConnection();
    Statement stmt = conn.createStatement();
    The connection seems to be gotten just fine. On the createStatement,
    I get the following exception.
    java.sql.SQLException: Internal error: Cannot obtain XAConnection
    Creation of XAConnection for pool ModelXaPool failed after
    waitSecs:298
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:772)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130)
    at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
    at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.java:71)
    at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:42)
    Any suggestions/advice?
    Thanks,
    Dale

    Hi Dale,
    What version of Oracle are you using at least 8.1.7 is need to be able to
    use Oracle thin driver/XA. Also the JDBCConnectionPool and TxDataSource tags
    dont seem to match here. Both need to be targeted on to the same server. And
    the name of the pool in TxDataSource need to match the pool you have on the
    server.
    To setup oracle for XA you need to make sure this script is run on the
    server, initjvm.sql (It should be in your oracle installation rdbms scripts)
    and then grant select permission on dba_pending_transactions.
    Are you able to setup a connection pool with a non-XA driver?
    sree
    "Dale Bronk" <[email protected]> wrote in message
    news:[email protected]...
    My final goal is to have two xa pools pointing to different db's and
    have them in the same user transaction and do a 2 phase commit. I
    can't get past connecting to a single xa datasource. I have "Grant
    Select on DBA_PENDING_TRANSACTIONS to public".
    My config.xml snippet:
    <JDBCConnectionPool
    Name="ModelXaPool"
    Targets="WebApp"
    URL="jdbc:oracle:thin:@SERVER1:1521:DB"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="2"
    MaxCapacity="10"
    CapacityIncrement="2"
    Properties="user=uid;password=pw"
    RefreshMinutes="10"
    />
    <JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="ModelManagerTxDataSource"
    Name="ModelManagerTxDataSource"
    PoolName="ModelManagerXaPool"
    Targets="WebWORKS"
    />
    My code snippet:
    UserTransaction tx = msgCtx.getUserTransaction();
    tx.begin();
    java.sql.Connection conn =
    (DataSource)ctx.lookup("ModelManagerTxDataSource")).getConnection();
    Statement stmt = conn.createStatement();
    The connection seems to be gotten just fine. On the createStatement,
    I get the following exception.
    java.sql.SQLException: Internal error: Cannot obtain XAConnection
    Creation of XAConnection for pool ModelXaPool failed after
    waitSecs:298
    atweblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:772)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130)
    at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
    atweblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.jav
    a:71)
    atweblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:42)
    >
    Any suggestions/advice?
    Thanks,
    Dale

  • How to use setFireActionForSubmit with parameters and capture the parameter

    Hi,
    Can anyone explain how to use setFireActionForSubmit.
    I am extending the Controller of ShoppingCartPG. In the extended controller processRequest method I am adding a button to the table and setting up the setFireActionForSubmit, so when the button is pressed it raises the event associated with the setFireActionForSubmit.
    I need to pass the RequisitionLineId as a parameter which is present in the VO associated with the ShoppingCartPG.
    I have used the following code in processRequest
    =================================
    public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    super.processRequest(paramOAPageContext, paramOAWebBean);
    OATableBean otbRN=(OATableBean)paramOAWebBean.findIndexedChildRecursive("ItemTableRN");
    OASubmitButtonBean oasb= (OASubmitButtonBean)paramOAPageContext.getWebBeanFactory().createWebBean(paramOAPageContext,"BUTTON_SUBMIT");
    oasb.setID("addnInfo");
    oasb.setUINodeName("addnInfo");
    oasb.setText("Additional Info");
    String pageName = paramOAPageContext.getRootRegionCode();
    Hashtable params = new Hashtable (1);
    params.put ("param1", pageName);
    Hashtable paramsWithBinds = new Hashtable(1);
    paramsWithBinds.put ("param2", new OADataBoundValueFireActionURL(oasb, "${oa.encrypt.current.RequisitionLineId}"));
    oasb.setFireActionForSubmit("addnInfoEvent",params,paramsWithBinds,false,false);
    otbRN.addIndexedChild(oasb);
    =================================
    And in processFormRequest method I am capturing the event "addnInfoEvent" and trying to capture the RequisitionLineId which I have passed it as a parameter.
    This is the code I have used in processFormRequest.
    =================================
    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
    super.processFormRequest(paramOAPageContext, paramOAWebBean);
    OAApplicationModule localOAApplicationModule = paramOAPageContext.getApplicationModule(paramOAWebBean);
    String strEvent= paramOAPageContext.getParameter(EVENT_PARAM) ;
    if ("addnInfoEvent".equals(strEvent))
    Number localNumber = 0;
    try {
    localNumber = new Integer(ClientUtil.getDecryptedParameter(paramOAPageContext, "param2"));
    catch (Exception e) {e.printStackTrace();}
    String outmsg="Line ID : " + localNumber + ":" + strEvent;
    throw new OAException(outmsg,OAException.INFORMATION);
    =================================
    But I am not able to capture the RequisitionLineId which I have sent as a parameter.
    Can anyone let me know what I am doing wrong.

    Hi,
    This is the requested HTML Code
    ===============================
    <button id="N3:addnInfo:0" class="x7g" style="background-image:url(/OA_HTML/cabo/images/swan/btn-bg1.gif)" onclick="return _chain('submitForm(\'DefaultFormName\',1,{\'param1\':\'${oa.encrypt.current.RequisitionLineId}\',\'serverValidate\':\'1\',\'param2\':\'${oa.encrypt.current.RequisitionLineId}\',event:\'addnInfoEvent\',source:\'N3:addnInfo:0\'});return false;',*'submitForm*(\'DefaultFormName\',1,{\'_FORM_SUBMIT_BUTTON\':\'N34\'});return false',this,event,true)" type="submit">Additional Info</button>
    ===============================
    Hi I am not able to paste the HTML Code..some parts of HTML gets removed automatically when I paste it in the forum.
    Regards,
    Rohit

  • App developed using Jdev 3.2 and oracle 9.2: oracle internal error

    Good morning,
    I have developed a JSP application using Jdeveloper 3.2.3.
    Everything works fine under Oracle 8.x.
    One of our customers, a few days ago, decided to migrate to oracle 9.2, but he can't use our application anymore, because every time a javabean accesses the database, Oracle returns:
    ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
    What I should do, in order to let my customer use my JSP application under any ctual version of Oracle?
    1) Have I to install a newer version of Jdeveloper and simply recompile my application?
    2) Have I to download a special package to deliver to the customer using Oracle 9.2?
    3) Anything else?
    Thank you for your advices.

    Giambattista,
    Check your JDBC driver version.
    You will get this ORA-600:[ttcgcshnd-1] error if you have the JDBC driver 8.1.7.1 or earlier, and you try to connect to an Oracle 9.0.1 or later database.
    So, your app will work when connected to an Oracle8i database, but fail when trying to Oracle9i.
    The solution is to upgrade to the patched 8.1.7.2 JDBC driver, or better yet, use the latest JDBC driver that comes with JDeveloper 9.0.3 (which is JDBC 9.0.1 version).

  • BLOB insert behavior with thin driver using standard JDBC2.0 and ORACLE-JDBC2.0API

    We have a problem with a BLOB insert to an oracle 8.1.7 DB using Oracle 8.1.7 JDBC thin driver.We get socket read/write error after inserting 32k of data using the standard JDBC2.0 API but using the Oracle JDBC2.0API (using OracleResultSet) it goes fine. We have a requirement to use the standard JDBC2.0 so that our code works with multiple database vendors. Is there another way to get in the blob data with standard JDBC API & using thin driver...?
    thanks,
    Madhu
    Here is my sample test program that does both standard & oracle specific JDBC Blob test insert.
    import java.sql.*;
    import java.io.*;
    import oracle.sql.BLOB;
    import oracle.jdbc.driver.OracleResultSet;
    public class testBLOB {
    //trying to insert a huge file to a BLOB
    static String fileName = "/kernel/genunix";
    public static void main(String[] args) {
    String driverName = "oracle.jdbc.driver.OracleDriver";
    String dbURL = "jdbc:oracle:thin:@localhost:1521:test"; //thin driver
    String user = "BlobTest";
    String passwd = "BlobTest";
    Connection con=null;
    try {
    Class.forName(driverName);
    con=DriverManager.getConnection(dbURL, user,passwd);
    catch (Exception e) {
    e.printStackTrace();
    close(con);
    int i = 0;
    while (i < args.length) {
    if (args.equals("-f"))
    fileName = args[++i];
    i++;
    System.out.println("The file being Stored is: "+fileName);
    createTable(con);
    insertUsingOracleAPI(con);
    insertUsingJDBC20API(con);
    //readDB(con);
    static String getFileName() {
    return fileName;
    public static void close(Connection con) {
    try {
    if (con != null) {
    con.close();
    catch (Exception e) {
    System.exit(-1);
    public static void createTable(Connection con) {
    Statement stmt ;
    try {
    stmt = con.createStatement();
    stmt.execute("DROP TABLE basic_blob_table");
    stmt.close();
    catch (SQLException sqlEx) {
    System.out.println("Dropped the Table");
    try {
    stmt = con.createStatement();
    stmt.execute("CREATE TABLE basic_blob_table ( x varchar2(30), b blob)");
    stmt.close();
    catch (SQLException sqlEx) {
    sqlEx.printStackTrace();
    close(con);
    System.out.println("Created the Table");
    public static void insertUsingOracleAPI(Connection con) {
    OutputStream os = null;
    Statement stmt = null;
    ResultSet rs = null;
    FileInputStream is = null;
    try {
    con.setAutoCommit(false);
    stmt = con.createStatement();
    stmt.execute("INSERT INTO basic_blob_table VALUES( 'OracleAPI', empty_blob())");
    System.out.println("Inserted the dummy Row");
    rs = stmt.executeQuery("Select * from basic_blob_table where x='OracleAPI'");
    if (rs != null && rs.next()) {
    BLOB blob = ((OracleResultSet)rs).getBLOB(2);
    File file = new File(getFileName());
    is = new FileInputStream(file);
    os = blob.getBinaryOutputStream();
    byte[] chunk = new byte[1024];
    int length = -1;
    while((length = is.read(chunk)) != -1)
    os.write(chunk, 0,length);
    System.out.println("Inserted the File " + getFileName() );
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    if (os != null) {
    os.flush();
    os.close();
    if (is != null)
    is.close();
    stmt.close();
    con.commit();
    con.setAutoCommit(true);
    catch (Exception e) {}
    public static void insertUsingJDBC20API(Connection con) {
    PreparedStatement stmt = null;
    FileInputStream is = null;
    try {
    stmt = con.prepareStatement("INSERT INTO basic_blob_table VALUES(?,?)");
    File file = new File(getFileName());
    is = new FileInputStream(file);
    stmt.setString(1,"JDBC20API");
    stmt.setBinaryStream(2,is,(int)file.length());
    stmt.executeUpdate();
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    if (is != null)
    is.close();
    stmt.close();
    catch (Exception e) {}
    null

    Thanks for the response.
    I understand what you are saying...
    that readers don't block writers in Oracle (the same is true in SQL Server 2000).
    However, I don't see how my test case is working correctly with Oracle (the exact same code acting as I'm thinking it should with SQL Server, but I still think it is acting incorrectly with Oracle).
    I have transaction A do this:
    update <table> set <column2>=<value> where <column1>='1'
    then I use Thread.sleep() to make that program hang around for a few minutes.
    Meanwhile I sneak off and start another program which begins transaction B. I have transaction B do this:
    select * from <table> where <column1>='1'
    and the read works immediately (no blocking... just as you have said) however, transaction A is still sleeping, it has not called commit() or rollback() yet.
    So what if transaction A were to call rollback(), the value read by transaction B would be incorrect wouldn't it ?
    Both A and B use setAutoCommit(false) to start their transactions, and then call setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED).
    Isn't that supposed to guarantee that a reader can only read what is committed ?
    And if a row is in "flux"... in the process of having one or more values changed, then the database cannot say what the value will be ?
    I can almost see what you are saying.
    In letting the reader have what it wants without making it wait, I suppose it could be said that Oracle is holding true to the "only let committed data be read"
    So if that's it, then what if I want the blocking ?
    I want an entire row to be locked until whoever it in the middle of updating, adding, or removing it has finished.
    Do you know if that can be done with Oracle ? And how ?
    Thanks again for helping me.

Maybe you are looking for