Problems in SQL Connection from Java program to Oracle 8.1.7

Hi,
I am java program that connects to Oracle 8.1.7 .
Client: java code on Windows 2000
Server: oracle 8.1.7 on Solaris
Java code uses two types of Connection Pools. One Pool uses "thin" connections and other pool uses "OracleConnectionPoolDataSource" class.
The methods which use "thin" pool work great however the methods which use "OracleConnectionPoolDataSource" fail after 5 to 10 calls.
Given below is the exception that I see in my log file.
February 26, 2002 10:17:38 AM UTC: Debug.INFO: searchByNameCommono.jsp Error : Tpd2.openConnection(1)failed:DBConnPool2.getConnection(String) failed:Closed Connection
com.commerceone.msbtpdapi.util.DBConnException: Tpd2.openConnection(1)failed:DBConnPool2.getConnection(String) failed:Closed Connection
     at com.commerceone.msbtpdapi.api.Tpd2.openConnection(Tpd2.java:138)
     at com.commerceone.msbtpdapi.api.TpdDBApi.searchTpsByCompanynameAndStatus(TpdDBApi.java:1685)
Windows java code uses JDK 1.3.1
Oracle machine has java version 1.2.2.
Do I need to check for any settings like LD_LIBRARY_PATH on oracle machine ?
Thanks a lot.
Regards
Mandar

Hi,
I am java program that connects to Oracle 8.1.7 .
Client: java code on Windows 2000
Server: oracle 8.1.7 on Solaris
Java code uses two types of Connection Pools. One Pool uses "thin" connections and other pool uses "OracleConnectionPoolDataSource" class.
The methods which use "thin" pool work great however the methods which use "OracleConnectionPoolDataSource" fail after 5 to 10 calls.
Given below is the exception that I see in my log file.
February 26, 2002 10:17:38 AM UTC: Debug.INFO: searchByNameCommono.jsp Error : Tpd2.openConnection(1)failed:DBConnPool2.getConnection(String) failed:Closed Connection
com.commerceone.msbtpdapi.util.DBConnException: Tpd2.openConnection(1)failed:DBConnPool2.getConnection(String) failed:Closed Connection
     at com.commerceone.msbtpdapi.api.Tpd2.openConnection(Tpd2.java:138)
     at com.commerceone.msbtpdapi.api.TpdDBApi.searchTpsByCompanynameAndStatus(TpdDBApi.java:1685)
Windows java code uses JDK 1.3.1
Oracle machine has java version 1.2.2.
Do I need to check for any settings like LD_LIBRARY_PATH on oracle machine ?
Thanks a lot.
Regards
Mandar

Similar Messages

  • Calling oracle SQL Loader from java program

    Hi,
    I want to insert data into oracle tables from a text files containing fixed length fields. I am using SQLLoader to achieve this. The requirement is to call the SQLLoader within the java program.
    Does anyone know how to call SQL Loader from java program?
    Thanks,
    Varsha

    Simply "exec" the sqlldr program with the parameters you need to pass to it.
    Runtime.exec (........)
    Try to pass all parameters needed including the username and password, and use the option "silent" to avoid output, and the option "log" to have a log file of the modifications that sqlldr has done to the database.

  • How to connect from java without using oracle client installation

    hi ,
    Please tell me how to connect from java without using oracle client
    Thanks & Regars

    http://www.orafaq.com/wiki/JDBC#Thin_driver

  • Run dial-up connection from Java Program?

    Is there a way to run dial-up connection from a Java Program? It needs to platform independent.
    Thanks.
    Virum

    I very much doubt it, at least not platform independent. I had a, oops, heck of a time doing that from Visual Basic, where it is much easier to work with operating-system stuff like that than it is in Java. I finally ended up buying a RAS component to call from my VB program.

  • Calling SQL LOADER From Java Program

    Hi
    I need to invoke sql loader from inside a Java Class.
    Any Pointers in this regards will be really appreciated.
    Thanks
    Vishal

    You can create two different files which has sqlldr command defined....
    1. loader.sh
    2. loader.bat
    and in the depending on the OS execute one...
             String command = "";
             if(System.getProperty("os.name").equals("Windows 2000")){
                    //if os is windows 2000  then execute bat file
                     command =  <<bat file path>>
              }else{
                      command = <<shell path>>
              Runtime rt = Runtime.getRuntime();
              Process p = rt.exec(command);
              int i = p.exitValue();
             

  • [b]Unable to connect a Jdbc Program to Oracle database.[/b]

    Hi all,
    i am able to access Oracle database from server to my machine(client) without any connectivity of java.now,I am trying to connect my java program to Oracle database. i have no idea about any other driver.when i am trying to execute this code then it is showing fatal error: java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getConnection(Unknown Source)
    my code is here.if anyone is having idea then plz sort out it.
    Thanks n Regards,
    Abhi
    class Jdbc{   public static void main (String args [])throws SQLException, IOException{
    System.out.println ("Loading Oracle driver...");
         try {
         Class.forName ("sun.jdbc.odbc.JdbcOdbc");
           System.out.println("Driver Loaded!");}
         catch (ClassNotFoundException e) {
         System.out.println ("Could not load the driver");
         e.printStackTrace (); }
    System.out.println ("Connecting to the Oracle database...");
    String url = "Jdbc:Odbc:[email protected]:1521:rf","scott","tiger"
    //10.10.0.78 is oracle server IP address and rf is oracle instance.
    Connection conn = DriverManager.getConnection(url);

    Hi all,
    i am able to access Oracle database from server to my
    machine(client) without any connectivity of
    java.now,I am trying to connect my java program to
    Oracle database. i have no idea about any other
    driver.when i am trying to execute this code then it
    is showing fatal error: java.sql.SQLException: No
    suitable driver
    at java.sql.DriverManager.getConnection(Unknown
    n Source)
    my code is here.if anyone is having idea then plz
    sort out it.
    Thanks n Regards,
    Abhi
    class Jdbc{   public static void main (String args
    [])throws SQLException, IOException{
    System.out.println ("Loading Oracle driver...");
         try {
         Class.forName ("sun.jdbc.odbc.JdbcOdbc");
           System.out.println("Driver Loaded!");}
         catch (ClassNotFoundException e) {
         System.out.println ("Could not load the driver");
         e.printStackTrace (); }
    System.out.println ("Connecting to the Oracle
    database...");
    String url =
    "Jdbc:Odbc:[email protected]:1521:rf","scott","tiger"
    //10.10.0.78 is oracle server IP address and rf is
    oracle instance.
    Connection conn = DriverManager.getConnection(url);
    Hi , I dont know if u got the answer but couple of things i wanted to let u know.
    1. the driver u r using make it a thin driver as u r specifying that in the url .
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/winsoft.html
    loading class 'oracle.jdbc.driver.OracleDriver'
    and url u have to change a little, this depends on the driver u use.
    "jdbc:oracle:thin:@balrog:1521:testJdbc"
    Regards,
    Lakshmi Narayana
    /********************* the code which i have tested **************************/
    public class Jdbc {
         * @param args
         public static void main(String[] args)     throws SQLException, IOException{
                   System.out.println ("Loading Oracle driver...");
                        try {
                        Class.forName ("oracle.jdbc.driver.OracleDriver");
                        System.out.println("Driver Loaded!");}
                        catch (ClassNotFoundException e) {
                        System.out.println ("Could not load the driver");
                        e.printStackTrace (); }
                   System.out.println ("Connecting to the Oracle database...");
                   String url = "\"Jdbc:Odbc:[email protected]:1521:rf\",\"scott\",\"tiger\"";
    //               10.10.0.78 is oracle server IP address and rf is oracle instance.
                   Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@balrog:1521:testJdbc","ispsapp","ispsappbalrog");
                   Statement st = conn.createStatement();
                   ResultSet rs = st.executeQuery("select * from BC_PMT_APPLN");
                   if (rs.next()){
                        System.out.println("Column Count ="+rs.getMetaData().getColumnCount());
    }

  • Connect to MS Sql Server from Java Source

    Hi,
    Is there any way I could connect to ms sql server from Java source? I know I can call java source from function thats easy but what I really want is capability to connect to non-oracle(MS SQL server) from my java source and then call it from function.
    I don't know if JDBC driver for SQL server is even installed/available. Is there a way I could find it out form my IDE? I know sqlJ does compile but I have never used sqlj. help!!!
    Sinha

    You'll probably have better luck in a Java forum or a Microsoft forum.

  • How to connect iseries green screen from java program

    how to connect iseries green screen from java program to get the data in the DB files ,here the DB is DB2/400

    Just some Friday fun. Use the telnet program that comes with Windows and supports VT escape sequences.
    import java.io.*;
    import java.net.*;
    public class AutoTelnet {
         private static Socket s;
         public static void main(String[] args) throws Exception {
              Thread t = new Thread() {
                   @Override public void run() {
                        try {
                             s = new ServerSocket(5555).accept();
                        } catch (IOException ex) {
                             ex.printStackTrace();
              t.start();
              Process p = new ProcessBuilder("cmd", "/C", "start", "telnet", "127.0.0.1", "5555").redirectErrorStream(true).start();
              t.join();
              PrintStream ps = new PrintStream(s.getOutputStream());
              ps.println("Screen will be cleared in 5 seconds");
              ps.println("5");
              Thread.sleep(1000);
              ps.println("4");
              Thread.sleep(1000);
              ps.println("3");
              Thread.sleep(1000);
              ps.println("2");
              Thread.sleep(1000);
              ps.println("1");
              Thread.sleep(1000);
              ps.println("\u001b[2J");
              Thread.sleep(5000);
    }

  • Problem while running dos command from java program

    Dear friends,
    I need to terminate a running jar file from my java program which is running in the windows os.
    For that i have an dos command to find process id of java program and kill by using tskill command.
    Command to find process id is,
    wmic /output:ProcessList.txt process where "name='java.exe'" get commandline,processid
    This command gives the ProcessList.txt file and it contains the processid. I have to read this file to find the processid.
    when i execute this command in dos prompt, it gives the processid in the ProcessList.txt file. But when i execute the same command in java program it keeps running mode only.
    Code to run this command is,
    public class KillProcess {
         public static void main(String args[]) {
              KillProcess kProcess = new KillProcess();
              kProcess.getRunningProcess();
              kProcess = new KillProcess();
              kProcess.readProcessFile();
         public void getRunningProcess() {
              String cmd = "wmic /output:ProcessList.txt process where \"name='java.exe'\" get commandline,processid";
              try {
                   Runtime run = Runtime.getRuntime();
                   Process process = run.exec(cmd);
                   int i = process.waitFor();
                   String s = null;
                   if(i==0) {
                        BufferedReader stdInput = new BufferedReader(new
                               InputStreamReader(process.getInputStream()));
                        while ((s = stdInput.readLine()) != null) {
                         System.out.println("--> "+s);
                   } else {
                        BufferedReader stdError = new BufferedReader(new
                               InputStreamReader(process.getErrorStream()));
                        while ((s = stdError.readLine()) != null) {
                         System.out.println("====> "+ s);
                   System.out.println("Running process End....");
              } catch(Exception e) {
                   e.printStackTrace();
         public String readProcessFile() {
              System.out.println("Read Process File...");
              File file = null;
              FileInputStream fis = null;
              BufferedReader br = null;
              String pixieLoc = "";
              try {
                   file = new File("ProcessList.txt");
                   if (file.exists() && file.length() > 0) {
                        fis = new FileInputStream(file);
                        br = new BufferedReader(new InputStreamReader(fis, "UTF-16"));
                        String line;
                        while((line = br.readLine()) != null)  {
                             System.out.println(line);
                   } else {
                        System.out.println("No such file");
              } catch (Exception e) {
                   e.printStackTrace();
              return pixieLoc;
    }     when i remove the process.waitFor(), then while reading the ProcessList.txt file, it says "No such file".
    if i give process.waitFor(), then it's in running mode and program is not completed.
    Colud anyone please tell me how to handle this situation?
    or Is there anyother way to kill the one running process in windows from java program?
    Thanks in advance,
    Sathish

    Hi masijade,
    The modified code is,
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        StreamGobbler(InputStream is, String type)
            this.is = is;
            this.type = type;
        public void run()
            try
                InputStreamReader isr = new InputStreamReader(is, "UTF-16");
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    System.out.println(type + ">" + line);
                } catch (IOException ioe)
                    ioe.printStackTrace(); 
    public class GoodWindowsExec
        public static void main(String args[])
            try
                String osName = System.getProperty("os.name" );
                String[] cmd = new String[3];
                 if( osName.equals( "Windows 95" ) )
                    cmd[0] = "command.com" ;
                    cmd[1] = "/C" ;
                    cmd[2] = "wmic process where \"name='java.exe'\" get commandline,processid";
                } else {
                    cmd[0] = "cmd.exe" ;
                    cmd[1] = "/C" ;
                    cmd[2] = "wmic process where \"name='java.exe'\" get commandline,processid";
                Runtime rt = Runtime.getRuntime();
                System.out.println("Execing " + cmd[0] + " " + cmd[1]
                                   + " " + cmd[2]);
                Process proc = rt.exec(cmd);
                System.out.println("Executing.......");
                // any error message?
                StreamGobbler errorGobbler = new
                    StreamGobbler(proc.getErrorStream(), "ERROR");           
                          // any output?
              StreamGobbler outputGobbler = new
                    StreamGobbler(proc.getInputStream(), "OUTPUT");
                          // kick them off
                errorGobbler.start();
                outputGobbler.start();
                // any error???
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);       
            } catch (Throwable t)
                t.printStackTrace();
    }when i execute the above code, i got output as,
    Execing cmd.exe /C wmic process where "name='java.exe'" get commandline,processid
    and keeps in running mode only.
    If i execute the same command in dos prompt,
    CommandLine
    ProcessId
    java -classpath ./../lib/StartApp.jar;./../lib; com.abc.middle.startapp.StartAPP  2468
    If i modify the command as,
    cmd.exe /C wmic process where "name='java.exe'" get commandline,processid  > 123.txt
    and keeps in running mode only.
    If i open the file when program in running mode, no contents in that file.
    If i terminte the program and if i open the file, then i find the processid in that file.
    Can you help me to solve this issue?

  • MySQL trying to connect my java program

    I am trying to write a java program that I can connect to a MySQL database on my compter. I have typed out this example that is in a text book I have and I am trying to connect my java program to a MySQL database. The version of MySQL is 4.1 which I have recently downloaded onto my computer and is working fine. The problem I am having is in ther places where it says "WHAT DO I ENTER HERE", basically the 'database.properties' , the 'jdbc.drivers' and the 'jdbc.url' string names. I do not know what I am supposed to enter. If you could give me some help with what I am supposed to enter or an example of a java program that already works with MySQL that would be of great help to me. A working example would be the greatest help to me .
    Thank-you.
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    class TestDB
    public static void main (String args[])
      try
        Connection conn = getConnection();
        Statement stat = conn.createStatement();
        stat.execute("CREATE TABLE Greetings (Name CHAR(20))");
        stat.execute("INSERT INTO Greetings VALUES ('Hello World!')");
        ResultSet result = stat.executeQuery("Select * From Greetings");
        result.next();
        System.out.println(result.getString(1));
        result.close();
        stat.execute("DROP TABLE Greetings");
        stat.close();
        conn.close();
      catch (SQLException ex)
       while (ex != null)
         ex.printStackTrace();
         ex = ex.getNextException();
      catch (IOException ex)
       ex.printStackTrace();   
    public static Connection getConnection() throws SQLException, IOException
       Properties props = new Properties();
       FileInputStream in = new FileInputStream("WHAT DO I ENTER HERE");
       props.load(in);
       in.close();
       String drivers = props.getProperty("WHAT DO I ENTER HERE");
       if(drivers != null)
         System.setProperty("WHAT DO I ENTER HERE", drivers);
       String url = props.getProperty("WHAT DO I ENTER HERE");
       String username = props.getProperty("jdbc.username");
       String password = props.getProperty("jdbc.password");
       return
         DriverManager.getConnection(url, username, password);
    }

    public static Connection getConnection() throws SQLException, IOException {
       Properties props = new Properties();
       // It could be absolute or relative path.
       // If the properties file is in the same dir, use the name as shown below.
       FileInputStream in = new FileInputStream("database.properties");
       props.load(in);
       in.close();
       // It will load the driver String from properties
       String drivers = props.getProperty("jdbc.drivers");
       if(drivers != null)
         System.setProperty("jdbc.drivers", drivers);
         // If drivers are not set in properties, set them now.
       String url = props.getProperty("jdbc.url");
       String username = props.getProperty("jdbc.username");
       String password = props.getProperty("jdbc.password");
       return DriverManager.getConnection(url, username, password);
      }Have a look at the comments I inserted. :)

  • Error in ONS logs while implmenting FCF on oracle RAC from java program

    I have java prog on client machine that uses properties from a property file.While making the connection to the ONS port on the oracle RAC server to implement FCF the program is throwing error as below:
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    and when i checked the ons logs for that node the logs are as follows:
    Connection 5,199.xxx.xxxxxx,8200 header RCV failed (Connect
    ion reset by peer) coFlags=1002a
    These logs are generated only when java program tries to connect else the daemon started without any errors.
    But sometime it connets and gives the desired output.
    Please advice and do let me know in case you need more information.
    Java program on the client machine is as follows..
    * Oracle Support Services
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Enumeration;
    import java.util.Properties;
    import java.util.ResourceBundle;
    import oracle.jdbc.pool.OracleConnectionCacheManager;
    import oracle.jdbc.pool.OracleDataSource;
    public class FCFConnectionCacheExample
    private OracleDataSource ods = null;
    private OracleConnectionCacheManager occm = null;
    private Properties cacheProperties = null;
    public FCFConnectionCacheExample() throws SQLException
    // create a cache manager
    occm = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
    Properties props = loadProperties("fcfcache");
    cacheProperties = new java.util.Properties();
    cacheProperties.setProperty("InitialLimit", (String)props.get("InitialLimit"));
    cacheProperties.setProperty("MinLimit", (String)props.get("MinLimit"));
    cacheProperties.setProperty("MaxLimit", (String)props.get("MaxLimit"));
    ods = new OracleDataSource();
    ods.setUser((String)props.get("username"));
    ods.setPassword((String)props.get("password"));
    ods.setConnectionCachingEnabled(true);
    ods.setFastConnectionFailoverEnabled(true);
    ods.setConnectionCacheName("MyCache");
    ods.setONSConfiguration((String)props.get("onsconfig"));
    ods.setURL((String)props.get("url"));
    occm.createCache("MyCache", ods, cacheProperties);
    private Properties loadProperties (String file)
    Properties prop = new Properties();
    ResourceBundle bundle = ResourceBundle.getBundle(file);
    Enumeration enumlist = bundle.getKeys();
    String key = null;
    while (enumlist.hasMoreElements())
    key = (String) enumlist.nextElement();
    prop.put(key, bundle.getObject(key));
    return prop;
    public void run() throws Exception
    Connection conn = null;
    Statement stmt = null;
    ResultSet rset = null;
    String sQuery =
    "select sys_context('userenv', 'instance_name'), " +
    "sys_context('userenv', 'server_host'), " +
    "sys_context('userenv', 'service_name') " +
    "from dual";
    try
    conn = null;
    conn = ods.getConnection();
    stmt = conn.createStatement();
    rset = stmt.executeQuery(sQuery);
    rset.next();
    System.out.println("-----------");
    System.out.println("Instance -> " + rset.getString(1));
    System.out.println("Host -> " + rset.getString(2));
    System.out.println("Service -> " + rset.getString(3));
    System.out.println("NumberOfAvailableConnections: " +
    occm.getNumberOfAvailableConnections("MyCache"));
    System.out.println("NumberOfActiveConnections: " +
    occm.getNumberOfActiveConnections("MyCache"));
    System.out.println("-----------");
    catch (SQLException sqle)
    while (sqle != null)
    System.out.println("SQL State: " + sqle.getSQLState());
    System.out.println("Vendor Specific code: " +
    sqle.getErrorCode());
    Throwable te = sqle.getCause();
    while (te != null) {
    System.out.print("Throwable: " + te);
    te = te.getCause();
    sqle.printStackTrace();
    sqle = sqle.getNextException();
    finally
    try
    rset.close();
    stmt.close();
    conn.close();
    catch (SQLException sqle2)
    System.out.println("Error during close");
    public static void main(String[] args)
    System.out.println(">> PROGRAM using JDBC thin driver no oracle client required");
    System.out.println(">> ojdbc14.jar and ons.jar must be in the CLASSPATH");
    System.out.println(">> Press CNTRL C to exit running program\n");
    try
    FCFConnectionCacheExample test = new FCFConnectionCacheExample();
    while (true)
    test.run();
    Thread.currentThread().sleep(10000);
    catch (InterruptedException e)
    System.out.println("PROGRAM Ended by user");
    catch (Exception ex)
    System.out.println("Error Occurred in MAIN");
    ex.printStackTrace();
    Some of the info i have deleted intensionally as this is confidential
    Property file is as follows
    # properties required for test
    username=test
    password=test
    InitialLimit=10
    MinLimit=10
    MaxLimit=20
    onsconfig=nodes=RAC-node1:port,RAC-node2:port
    url=jdbc:oracle:thin:@(DESCRIPTION= \
    (LOAD_BALANCE=yes) \
    (ADDRESS=(PROTOCOL=TCP)(HOST=RAC-node1)(PORT=1521)) \
    (ADDRESS=(PROTOCOL=TCP)(HOST=RAC-node1)(PORT=1521)) \
    (CONNECT_DATA=(service_name=RAC_SERVICE)))

    Hi;
    Please check below note:
    Link Errors While Installing CRS & RAC Database software [ID 438747.1]
    Codeword File $TIMEBOMB_CWD,/opt/aCC/newconfig/aCC.cwd Missing Or Empty [ID 552893.1]
    Regard
    Helios

  • Error PLS-00306 during calling PL/SQL function from Java

    Hi all,
    I am facing a problem during call of oracle PL/SQL function from java using CallableStatement.
    I receive following error message.
    java.sql.SQLException: ORA-06550: line 1, column 13:
    PLS-00306: wrong number or types of arguments in call to 'EXPORT_HIST_ALARMS_FUNC'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    As per above error EXPORT_HIST_ALARMS_FUNC in oracle has this signature.
    CREATE OR REPLACE FUNCTION EXPORT_HIST_ALARMS_FUNC(startDateTime VARCHAR2, endDateTime VARCHAR2, meType VARCHAR2) RETURN VARCHAR2 IS
    END EXPORT_HIST_ALARMS_FUNC;
    Above function I have called following way in java.
    String sql = "begin ?:= EXPORT_HIST_ALARMS_FUNC(?, ?, ?); end;" ;
    CallableStatement cStatement = null;
    cStatement = connection.prepareCall(sql);
    cStatement.registerOutParameter(1,Types.VARCHAR);
    cStatement.setString(2,startDateTime);
    cStatement.setString(3,endDateTime);
    cStatement.setString(4,meType);
    cStatement.execute();
    msg = cStatement.getString(1);
    Actually above function requires three input parameters and one return parameter.
    During execution of above java code it throws SQLException and shows PLS-00306: wrong number or types of arguments in call to 'EXPORT_HIST_ALARMS_FUNC' error.
    I have run this function directly from oracle with three parameters and run successfully and finally it returns string.
    But I am unable to figure out why it doesn't run from above java code.
    Please help regarding this.
    Thanks.
    Regards,
    Shardul Banker

    Try this:
    String sql = "begin ?:= EXPORT_HIST_ALARMS_FUNC(?, ?, ?); end;" ;
    CallableStatement cStatement = null;
    cStatement = connection.prepareCall(sql);
    cStatement.registerOutParameter(1,Types.VARCHAR);
    cStatement.setString(1,startDateTime);
    cStatement.setString(2,endDateTime);
    cStatement.setString(3,meType);
    cStatement.execute();
    msg = cStatement.getString(1);Regards,
    Martijn Teigeler
    Edited by: mTeigeler on Oct 13, 2007 10:22 AM

  • How to approve the step from java program ?

    Hi all,
    I want to approve a step from java program.
    I call the store function "wf_notification.setattrtext" & "wf_notification.respond".
    It's not work.
    The notification's status become to 'CLOSE', but PO_REQUISITION_HEADERS_ALL.AUTHORIZATION_STATUS is 'IN PROCESS'.
    And I try to approve the flow from oracle web gui and it's OK !
    The notification's status become to 'CLOSE', but PO_REQUISITION_HEADERS_ALL.AUTHORIZATION_STATUS is 'APPROVED'.
    The java program as follows, and '1099999' is notification id.
    Can anyone please please please help me?
    Thanks, all.
    Gavin
    ===================================================================================================
    import java.util.*;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.rmi.*;
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class CommitPR
    public static void main(String[] aArgs) throws Exception
    String driver = "oracle.jdbc.driver.OracleDriver";
    String url = "jdbc:oracle:thin:@10.1.1.1:1521:ORA";
    String user = "user";
    String password = "password";
    Class.forName(driver).newInstance();
    String sql;
    Connection conn = null;
    Statement callStmt;
    conn = DriverManager.getConnection(url, user, password);
    conn.setAutoCommit(true);
    callStmt = conn.createStatement();
    sql = "{ CALL WF_NOTIFICATION.SETATTRTEXT ('1099999','RESULT','APPROVE') }";
    System.out.println("sql=" + sql);
    callStmt.execute(sql);
    sql = "{ CALL WF_NOTIFICATION.RESPOND ('1099999','ARRPOVED','EIP_ADMIN') }";
    System.out.println("sql=" + sql);
    callStmt.execute(sql);
    callStmt.close();
    conn.close();
    ===================================================================================================

    Hi,
    the JavaAPI didn't work with the xdo-Files. But you can create a proxy stub for the Web Service API of BI Publisher which uses the xdo's in the repository.
    regards
    Rainer

  • Problem wtih JDBC Connecting in jsf program.

    Hey guys. I have a web app setup thanks to some of you guys on here. I'm using mysql jdbc access for login. I'm using the connection pool and resource for connectivity.
    Basically what I'm asking is can I use to DataSource variables on the same page. The reason I'm asking that is. I can connect fine with the login code.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package beans;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import javax.annotation.Resource;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpSession;
    import javax.sql.DataSource;
    * @author Drew
    public class Login {
        @Resource(name = "jdbc/must2")
        private DataSource ds;
        private String email;
        private String password;
         * @return the email
        public String getEmail() {
            return email;
         * @param email the email to set
        public void setEmail(String email) {
            this.email = email;
         * @return the password
        public String getPassword() {
            return password;
         * @param password the password to set
        public void setPassword(String password) {
            this.password = password;
        public String VerifyUser() throws SQLException {
            if (this.email.equals("") || this.password.equals("")) {
                return "fail";
            } else {
                if (ds == null) {
                    throw new SQLException("No data source");
                Connection conn = ds.getConnection();
                if (conn == null) {
                    throw new SQLException("No connection");
                try {
                    PreparedStatement passwordQuery = conn.prepareStatement("SELECT password from user WHERE email = ?");
                    passwordQuery.setString(1, this.email);
                    ResultSet result = passwordQuery.executeQuery();
                    result.next();
                    String storedPassword = result.getString("password");
                    System.out.println(storedPassword);
                    if (this.password.equals(storedPassword)) {
                        FacesContext context = FacesContext.getCurrentInstance();
                        HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
                        HttpSession httpSession = request.getSession();
                        httpSession.setAttribute("login", "Login");
                        System.out.println("Success");
                        return "success";
                    } else {
                        return "fail";
                } finally {
                    conn.close();
                    System.out.println("Login connection closed");
    }Ok now I have some separate code that access the same database but fills a table on the same login.jspx page.
    package page;
    import java.util.ArrayList;
    import classes.Line;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.annotation.Resource;
    import javax.sql.DataSource;
    public class LineStatus {
        @Resource(name = "jdbc/must2")
        private DataSource ds;
        private ArrayList line = new ArrayList();
        public LineStatus() {
            try {
                GetLineStatus();
            } catch (SQLException ex) {
                Logger.getLogger(LineStatus.class.getName()).log(Level.SEVERE, null, ex);
        public void GetLineStatus() throws SQLException {
            if (ds == null) {
                throw new SQLException("No data source");
            Connection conn = ds.getConnection();
            if (conn == null) {
                throw new SQLException("No connection");
            try {
                PreparedStatement passwordQuery = conn.prepareStatement("SELECT DISTINCT pkg_line_id,shortname, " +
                        "line_status FROM pkg_line_tree LEFT JOIN pkg_line using (pkg_line_id) " +
                        "WHERE tree_id = ? ORDER by shortname");
                passwordQuery.setInt(1, 3075);
                System.out.println(passwordQuery);
                ResultSet result = passwordQuery.executeQuery();
                while (result.next()) {
                    line.add(new Line(58285, "Line 1", "Test", 43500, 21695));
            } finally {
                conn.close();
        public ArrayList getLine() {
            return line;
    }There is nothing wrong with the code. I checked it over and over. Even replaced this code with my same login code that works. Every time I run the page I get "no data source". Obviously becasue Datasource is null. I have setup to catch the error. I'm guessing that the two backing beans can't access the same data base on the same page. I'm not sure though. I need to figure out how to get around this. Thanks for any help guys.
    Edited by: dothedru22 on Oct 16, 2009 7:44 AM

    Anybody know? I've tried everything I can think of.

  • SOLVED: How To Use LDAP over SSL (no certs) from java program

    Trying to connect to OID from Java program (using Grocery Store demo as a test). Want to use SSL with no server certificate. OID is configured, and ldapsearch -U 1 works.
    Tried using URL with ldaps, or adding SECURITY_PROTOCOL,"ssl". In both case the error is 'simple bind failed'.
    Samples on OTN say this should be possible, but then only have code for the non-ssl connection.
    Posting from others with this same question don't seem to have been answered.
    Message was edited by:
    user590350
    I have found that using ConnectionUtil.getSSLDirCtx() from Oracle will make a no-authentication SSL connection. An example in the sample code would be useful.

    Even with Java APIs, There is a way to talk through SSL without bothering about certificates. It's just that you will have to write some code and make some changes in settings.
    Read following to get further information on the same.
    http://kiranthakkar.blogspot.com/2007/04/dummny-certificate-authentication.html
    I don't know or I won't comment whether it's the right approach or not but it's definitely a work around.
    Thanking You
    Kiran Thakkar

Maybe you are looking for