IntelliJ Java IDE
The moose likes JDBC and the fly likes Connection Failing Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JDBC
Reply Bookmark "Connection Failing" Watch "Connection Failing" New topic
Author

Connection Failing

deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 136
Hi,

I have wriiten a sample program just fro testing its not showing any result




I was reading some blog and it was written there that we have to download some drivers. from where we have to download drivers and what drivers we have to download and where we have to place those drivers


thanks in advance

[moderator edit: added code tags]
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2207

Hi Deepak,


In the catch block, you can print the exception you are getting. Currently it is empty, so you are running blind.
Can you show us the error message?

I added code tags to your post to make it more readable.

Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 112

If you don't have drivers, that's probably a problem, and your stack trace will probably be a ClassNotFoundException on line 09.

Since this is an Oracle database you will need to download the ojdbc6.jar or ojdbc14.jar (6 is newer) and put it in your classpath.


Everything is theoretically impossible, until it is done. ~Robert A. Heinlein
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 136
Hi,

its not showing any error code is compiling fine , but it shuld error the result which its not showing...the console ouptut screen is coming where its just written press any key to continue.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2207

deepak carter wrote:Hi,

its not showing any error code is compiling fine , but it shuld error the result which its not showing...the console ouptut screen is coming where its just written press any key to continue.


Yes, because you don't print the errors.
See my previous advise:
In the catch block, you can print the exception you are getting. Currently it is empty, so you are running blind.
 
 
subject: Connection Failing
 
Threads others viewed
Sentinel-controlled loop with a String variable condition
Problem in retrieving data and store it in string
Nested while loop inside do...while loop?
JDBC Newbie
Class.forName("")
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture