Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unable to connect to oracle db through jstl

 
yo nara
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<sql:setDataSource url="jdbc racle:thin:@smssv01:1521 rcl"driver="oracle.jdbc.driver.OracleDriver" user="yogesh" password="yogesh"
var="dataSource"
--------------------------------------------------
gives following error:
---------------------------------------------
javax.servlet.ServletException: In <driver>, invalid driver class name: "oracle/jdbc/driver/OracleDriver"
 
jawwad ahmed
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi;
Well make sure that u have import the driver in your tag handler class.And giving correct sid.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A common problem with Oracle drivers is that they are contained in a .zip rather than a .jar file and don't get loaded. (and therefore aren't available)
Make sure the driver file ends with .jar and is somewhere your app can see it (note this does not necessarily mean the classpath)
ClassPath issues may be separate and would depend on the app server you are using.
Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"yogi",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jawwad ahmed:
Hi;
Well make sure that u have import the driver in your tag handler class.And giving correct sid.

There isn't a need to import the driver in your JSP page using JSTL; JSTL takes care of this automatically. (It's not the original poster's tag handler but JSTL's, in this case.)
You will, however, need to ensure that Oracle's drivers (e.g., classes12.zip) are present in your web application's WEB-INF/lib. You may need to rename this file to a JAR file in order for Tomcat to recognize it.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"yogi programmer",
Your name is still not valid.
yogi, yogi programmer and yogeshnaravane are all invalid.
It must be two words and must not be obviously ficticious.
A suggestion:
yogi naravane would be valid (I'm not sure what your last name is, this is just an option)
Thanks.
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic