Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Java project not connecting to Access database on my W7 bootcamp.
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
<blockquote data-quote="insinkerator" data-source="post: 1384443" data-attributes="member: 62041"><p>I have a Java project that reads and writes to a database for college, it's programmed in jGrasp, and it connects to a MS access database. It works on our W7 computers in college, but when I try to execute the same code on my Windows partition I get this error:</p><p></p><p>SQL Exception: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xc94 Thread 0xbac DBC 0x71b800</p><p></p><p>For what it's worth, this is the connection code:</p><p></p><p></p><p>[CODE]try { //try catch block for accessing database</p><p> </p><p> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");</p><p> String url = "jdbc:odbc:Driver={Microsoft Access Driver " +</p><p> "(*.mdb, *.accdb)};DBQ=C:\\Users\\Killian\\Desktop\\Java Project 2";</p><p> Connection con = DriverManager.getConnection(url); </p><p> Statement stmt = null;</p><p> ResultSet rs = null; </p><p> // SQL query command</p><p> String SQL = "SELECT * FROM tblEmployee";</p><p> stmt = con.createStatement();</p><p> rs = stmt.executeQuery(SQL);</p><p> while (rs.next()) {</p><p> username = (rs.getString("Username")); //assigns username value from table</p><p> password = (rs.getString("Password")); //assigns password value from table</p><p> }</p><p> con.close(); </p><p> } </p><p> catch (SQLException e) </p><p> {</p><p> System.out.println("SQL Exception: "+ e.toString());</p><p> } </p><p> catch (ClassNotFoundException cE) {</p><p> System.out.println("Class Not Found Exception: "+</p><p> cE.toString());</p><p> }</p><p>[/CODE]</p><p></p><p>Any ideas?</p></blockquote><p></p>
[QUOTE="insinkerator, post: 1384443, member: 62041"] I have a Java project that reads and writes to a database for college, it's programmed in jGrasp, and it connects to a MS access database. It works on our W7 computers in college, but when I try to execute the same code on my Windows partition I get this error: SQL Exception: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xc94 Thread 0xbac DBC 0x71b800 For what it's worth, this is the connection code: [CODE]try { //try catch block for accessing database Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:Driver={Microsoft Access Driver " + "(*.mdb, *.accdb)};DBQ=C:\\Users\\Killian\\Desktop\\Java Project 2"; Connection con = DriverManager.getConnection(url); Statement stmt = null; ResultSet rs = null; // SQL query command String SQL = "SELECT * FROM tblEmployee"; stmt = con.createStatement(); rs = stmt.executeQuery(SQL); while (rs.next()) { username = (rs.getString("Username")); //assigns username value from table password = (rs.getString("Password")); //assigns password value from table } con.close(); } catch (SQLException e) { System.out.println("SQL Exception: "+ e.toString()); } catch (ClassNotFoundException cE) { System.out.println("Class Not Found Exception: "+ cE.toString()); } [/CODE] Any ideas? [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Java project not connecting to Access database on my W7 bootcamp.
Top