[jboss-user] [jBPM] - Re: How to add Java code to the jbpm process

Jaiyachandhiran Thangaraju do-not-reply at jboss.com
Mon Oct 10 07:39:41 EDT 2011


Jaiyachandhiran Thangaraju [http://community.jboss.org/people/jaiyachandhiran] created the discussion

"Re: How to add Java code to the jbpm process"

To view the discussion, visit: http://community.jboss.org/message/630873#630873

--------------------------------------------------------------
Hi

Thanks for ur reply.  Now i have created a simple process and wrote a simple java code.

 *Java Code*

***public void execute(ExecutionContext executionContext) throws Exception {
  // TODO Auto-generated method stub
    String query = "SELECT login_name from rs_users";
  System.out.println("Testing JAVA Code");
     Class.forName("oracle.jdbc.driver.OracleDriver");
     Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","resonancedev","resonancedev");
     Statement stmt = con.createStatement();
     ResultSet rs = stmt.executeQuery(query);
     while (rs.next()) {
       String message = rs.getString("login_name");
           System.out.println("name-->" +message);
           }
         con.close();
  //executionContext.getContextInstance().setVariable("message", message);
  
 }
***
*





 I tried to start the process from console and i get the below error.     Failed to start process: class 'oracle.jdbc.driver.OracleDriver' could not be found by the process classloader I have added the jar file to the project, I need to know where to add this jar file? Please reply me
*
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/630873#630873]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111010/67cae72a/attachment.html 


More information about the jboss-user mailing list