Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Overwriting a Access Database using JDBC
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Tushar, post: 600103"] here is my code ........ even on using the update statemnt it is not updating the DB? Any suggestions? import java.sql.*; class Example { public static void main(String args[]) { try { String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + "c:/db2.mdb"; System.out.println(url); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection myConnection = DriverManager.getConnection(url,null, null); //SQL String q= " UPDATE Addresses SET ID='3',Name='MAnik',LastName='Desai',Spouse='Sabrina'"; Statement myStatement =myConnection.createStatement(); int rs = myStatement.executeUpdate(q); //Closing Statement myStatement.close(); //Closing Connection myConnection.close(); } catch(java.lang.Exception ex) { ex.printStackTrace(); } } } [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Overwriting a Access Database using JDBC
Top