hi all, I am using "sun.jdbc.odbc.JdbcOdbcDriver" doing a testing project using Access 2000 as the database. I run into a strange scenario: try{ con=DBUtil.getConnection(); Item it = new Item(con2); // some insert statement here con.commit(); //this line not work either!! }catch (Exception e){ e.printStackTrace(); }finally{ try{ if (con2!=null){ con2.close();// if I comment out this line, database not show the change at all!! } }catch(Exception e){ e.printStackTrace(); } } Even if I add a con.commit() doesn't help, (if without the con.close() ) Is it normal? Any comments? Thanks! [ May 07, 2002: Message edited by: Dairmon Lee ] [ May 07, 2002: Message edited by: Dairmon Lee ]
Yes, its a common problem. If you do a search of this forum, you'll find several probems refering to it like this one. Options are to close the connection, or perform a dummy select afterwards, both seem to 'flush' the operations. Dave
Also ( a side note ), I believe that Access does not support transactions, so con.commit() would be useless anyways. But this does sound like the problem David pointed out. Jamie
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: strange!! if not close, database not show ??