New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Java project not connecting to Access database on my W7 bootcamp.


Post Reply New Thread Subscribe

 
Thread Tools
insinkerator

 
Member Since: Jul 22, 2008
Posts: 59
insinkerator is an unknown at this point

insinkerator is offline
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());
               }
Any ideas?
QUOTE Thanks

Post Reply New Thread Subscribe


« Mac Dev. and Mountain Lion | FLTK and Xcode 4 »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
How to access shared WIndow folders from MAC using Java API coolrb OS X - Operating System 0 05-30-2011 03:54 AM
Snow Leopard > Firefox 3.6 > Java not working... slater OS X - Apps and Games 6 04-03-2011 10:03 AM
JNI with Xcode 3.0 - Adding Java Package niroshpg OS X - Operating System 2 05-28-2009 08:57 AM
Unable to open project files and XML Translation was aborted due to a critical error Fat Chocolate Movies and Video 1 04-06-2008 02:49 PM
Java From Terminal jdgti OS X - Development and Darwin 10 03-26-2005 07:16 PM

All times are GMT -4. The time now is 05:36 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?