1 Reply Latest reply on Feb 27, 2014 6:11 PM by Anshul

    Adding dependent libraries for java embedding in BPEL

    Powerlad

      Hi All,

       

      I am trying to insert data to database from java embedding in bpel process. Find below the code being used in java embedding

       

      try {   
            
      String driver = "oracle.jdbc.driver.OracleDriver";   
        String url = "jdbc:oracle:thin:@x.x.x.92:1523:dev3";   
        String username = "scott";   
      String password = "xxxx";   
      String var1="abc"; 
      String var2="software"; 
      int i=1;
          Class.forName(driver);   
          Connection conn = DriverManager.getConnection(url, username, password);
          PreparedStatement pstmt = null;
          String query = "insert into EMP(EMPNO,JOB,MGR) values(?, ?, ?)";   
         
            pstmt = conn.prepareStatement(query); // create a statement   
            pstmt.setInt(1, i); // set input parameter 1   
            pstmt.setString(2, var1); // set input parameter 2   
            pstmt.setString(3, var2); // set input parameter 3   
            pstmt.executeUpdate(); // execute insert statement   
          } catch (Exception e) {   
            System.out.println("error..."+e.printStackTrace());   
          }

       

      I have kept the ojdbc5 jar in SCA-INF\lib and added an import statement in BPEL source code using the below tag to refer the objects used in the code.

      <bpelx:exec import="java.sql.*"/>

      While comping I am ending p with error. Please help me out if there is any problem in the steps mentioned above.

      Thanks.