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 Relational Databases and the fly likes connect oracle database to my servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "connect oracle database to my servlet" Watch "connect oracle database to my servlet" New topic
Author

connect oracle database to my servlet

shobhita srinivasan
Greenhorn

Joined: Mar 18, 2010
Posts: 7
hi everyone
i am very new to java and i have been asked to connect to an oracle database through my servlet. i performed the exact same task with an access database but i am not able to do the same with an oracle database. i have made the necessary changes in including the jar files and i have also included the driver in the classpath. what more is to be done??? also when i give the command to view the classpath in eclipse the classpath does not show the added path of the oracle driver.

help required....!!!
prakash pawar
Ranch Hand

Joined: Mar 11, 2010
Posts: 42
Hi shobhita,

Before checking the conectivity from a servlet,Can you please the it from "Data Source Explorer" view of Eclipse IDE.

for Data Source Explorer navigate : Window > Show View > Datasource Explorer.

fill all the database credential detail and test the connection.

if it works there then if you are not wrong at code it should work.

good luck :-)

Edited to remove direct email: please read UseTheForumNotEmail. If you're dead-set on not helping anybody else, use a private message.


Regards,
Prakash Pawar.
shobhita srinivasan
Greenhorn

Joined: Mar 18, 2010
Posts: 7
hi there,

thanks for helping me out. i don't seen to have the plugin feature for the datasource view in my eclipse. is there any other way to check whether the connection has been made successfully. i get the exception that no suitable driver found.
As far as my knowledge goes(which is very very very less when it comes to java) i get this exception when the jar files required are not put in the classpath right??

i am sorry if my doubts sound really dumb

prakash pawar
Ranch Hand

Joined: Mar 11, 2010
Posts: 42
hi

I guess the version of your jar file is not compatible.

try with different jar file.

shobhita srinivasan
Greenhorn

Joined: Mar 18, 2010
Posts: 7
tried with a different driver too...!! still nt workin
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You're not really providing enough information to help. Like the jar you're using, the driver name you're using, the basics.
shobhita srinivasan
Greenhorn

Joined: Mar 18, 2010
Posts: 7
am using the odbc14.jar file and i am useing the oracle thin driver
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The driver *name*.

What *specific* error are you getting, and under what circumstances? Please see TellTheDetails and ItDoesntWorkIsUseless: it's really important that you help us help you; don't make us ask every little question.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connect oracle database to my servlet
 
jQuery in Action, 3rd edition