db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shaffin Bhanji <shaffin.bha...@gmail.com>
Subject Derby 10.5 + JDK1.6
Date Sat, 17 Oct 2009 03:34:12 GMT
Hello,

Please be patient as I am new to using Derby. I am using the embedded 
jdbc driver in my application and it seems that I am able to insert a 
row using java without any exceptions but when I browse using the table, 
I dont see the new row that I originally inserted. A snipped of my code 
looks as follows:

           Class.forName( DERBY_DRIVER ).newInstance();
           //Get a connection
           Connection conn = DriverManager.getConnection( 
"jdbc:derby:directory:/home/shaffin/testdb;create=true", "admin", 
"password" );
           conn.setAutoCommit(true);
                     PreparedStatement stmt = 
conn.prepareStatement("insert into tbltest (fld1, fld2) values(?,?)");
           stmt.setString(1, "fld1test");
           stmt.setString(2, "fld2test");

           c = stmt.executeUpdate();

           stmt.close();
           conn.close();

Any help is kindly appreciated.

Shaffin.


Mime
View raw message