Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do you connect jsp to Oracle?  RSS feed

 
Yinka Olicks
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm having problems connecting to Oracle using jsp. The (startup and) error messages I got are:




The line(s) which I use to connect to the database from the jsp is as follows:



where the SID is "angel" , and the name and the password are "test","test");

This statement among the startup messages "Binding DataSource, name = jdbc/Cloudscape, url = jdbc:cloudscape:rmi:Cloudscape" is making me think that I first have to tell J2EE that I'm using Oracle and not cloudscape and also specify the url.

Is my diagnosis right?

How then do I do this?

Any useful answer or suggestion would be greatly appreciated.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Caveat: I've no idea what Cloudscape is.

OK, the problem here appears to be that your J2EE app server can't see your Oracle JDBC driver. To make your existing code work (or at least to get over the hump) you need put the Oracle JDBC driver JAR somewhere it'll be visible to your app server, or at least to your web app. For a web app this is typically {app-context}/WEB_INF/lib. You may want to put it somewhere common to all web apps instead.

Your app server is using a DataSource to connect to Cloudscape at start-up. You can configure it to connect to Oracle in this way too (or instead); I'm not exactly sure how (never done it) and it may depend on which app server you're using. If you do that you'll need to change the way your code connects to the DB to use JNDI (InitialContext) and DataSource. This is the recommended approach.

Hope that helps.

Jules
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!