File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes connection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connection problem" Watch "connection problem" New topic
Author

connection problem

Mike Ottinger
Ranch Hand

Joined: Jan 11, 2002
Posts: 125
I'm working on WIN 2k pro and I have a simple Access database that I'm trying to connect to. I set up a data source in control panel, went through the advance function and made an anonymous user and a guest password available. So in my code, when I call
DriverManager.getConnection( url, username, password );
it throws an SQLException on me. I've tried everything I can think of, creating a user dsn and a system dsn (what's the difference?). I tried placing the saved database in the same directory as my source code,no luck. I named the database the same as the dsn. I used for url:
jdbc dbc:user
and I had loaded the driver class with this:
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );

does anybody no if I missed something?


SCJP 1.4 SCJD 1.5
Mike Ottinger
Ranch Hand

Joined: Jan 11, 2002
Posts: 125
Nevermind guys, I figured it out. I didn't select the db when I set up the dsn!
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Originally posted by Mike Ottinger:
Nevermind guys, I figured it out. I didn't select the db when I set up the dsn!


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connection problem
 
Similar Threads
JRun not been able to Access the DSN
Query about DSN and DSN less Connection??
DSN problem
Connecting to MSSQL2000
Topspeed INSERT statement issue