This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes Problem connecting to Access database. Help needed.. 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 "Problem connecting to Access database. Help needed.." Watch "Problem connecting to Access database. Help needed.." New topic
Author

Problem connecting to Access database. Help needed..

Bimbo Adeniyi
Greenhorn

Joined: Oct 28, 2003
Posts: 4
Greetings,
I have this little problem connecting the Java application I'm currently developing to a database on my PC.
My PC's operation system is Windows 2000. And I have J2sdk1.4.0 installed.
I'm trying to create what looks like a database which a bank would have. I created the database using Microsoft Access,it only contains a only one row presently.....
The program was inspired by the Dietel and Dietel How to program book, 5th edition.



When the program is run, the error message I get is a error message dialog that says "No suitable driver"
and titled Database Error.
I have read all that's there to be read on the official Java tutorial on the JDBC database access. Especially, the page titled Establishing connection. It now appears I haven't configured my database correctly. But I've done all I think I should ..... I went to administrative tools,in control panel and clickinig on data sources and then the MSAccess database (which I think I made to appear there on the resulting tabbed pane applet ,somehow), and tried my best to configure the database (like the tutorial said I should), the best way I could intuitively.
How can I get my program to work? The example in the book uses cloudscape, but I am trying to Use Microsoft access and I'm attemtping to modify the program to do so...
Any useful suggestions would be greatly appreciated.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

your database URL is incorrect andshould be separated by colons:

just wondering if you can run a non-jdbc program? Also, if you could cut and paste the exception message, that would help too.
Jamie
Bimbo Adeniyi
Greenhorn

Joined: Oct 28, 2003
Posts: 4
Thanks so much for the answer Jamie Robertson
I have corrected the error and still got the same message.
The error message doesn't get displayed on the command prompt, and I had described what the little panel that gets displayed when I run the program says. The title of the little 'windows' is "Database error", and the message at the center of it is "No suitable driver", and an OK button just beneath it.
Bimbo.
Bimbo Adeniyi
Greenhorn

Joined: Oct 28, 2003
Posts: 4
I've corrected the error... I thought I had when I put up the first post.
The message I now got was "No data found". And the 'little window or panel' titled, "Database error".
I think I've resolved the first problem, but a new one has cropped up now..
Can anyone figure out what I'm doing wrong?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Bimbo Adeniyi:
I've corrected the error... I thought I had when I put up the first post.
The message I now got was "No data found". And the 'little window or panel' titled, "Database error".
I think I've resolved the first problem, but a new one has cropped up now..
Can anyone figure out what I'm doing wrong?

The only reason your error message is not printing out to the console is because you didn't code your exception routine to do it. Add the following line to this exception block:

this line will give you the error and the line that the exception occurred( you could identify this to us, since we can't see the line numbers in your code ). Cut and paste the stack trace here and we'll help you figure this one out.
Jamie
p.s. It has been my experience that JDBC DBC SQLException messages are bad at best and misleading at worst. So the best way to trouble shoot is to find the line that is causing you problems, and figure out why it is bombing out by looking at the code, not the error message.
Bimbo Adeniyi
Greenhorn

Joined: Oct 28, 2003
Posts: 4
Thanks so much for the answer, twas so helpful...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem connecting to Access database. Help needed..