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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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!


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: connection problem