1 Reply Latest reply on Apr 16, 2002 5:34 AM by Lars Bergmann

    Why I can not insert record into Oracle database?

    leaderq Newbie

      Now I use the BMP to insert record into Oracle databse. But after run my program, I find no data in my DB. I have set a datasource in my Jboss. And not any wrong to be reported. Could you tell me the reason.

      My code:
      public class Test2Bean implements SessionBean {
      //my romote method
      ......
      public void insertData() {
      try {
      String mySQL = "insert into test values('abc')";
      Context ictx = new InitialContext();
      testDS = (DataSource)ictx.lookup("java:/LeaderqDS");
      testConn = testDS.getConnection();
      testStmt = testConn.createStatement();
      testStmt.executeUpdate(mySQL);
      testStmt.close();
      testConn.close();
      } catch(Exception e) {
      e.printStackTrace();
      }
      ......
      }