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 Failing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Failing" Watch "Connection Failing" New topic
Author

Connection Failing

deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
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: 2477
    
    7

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.


OCUP UML fundamental and ITIL foundation
youtube channel
Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 171
    
    5

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: 165
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: 2477
    
    7

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
 
Similar Threads
Class.forName("")
Problem in retrieving data and store it in string
JDBC Newbie
Nested while loop inside do...while loop?
Sentinel-controlled loop with a String variable condition