Oracle Data source Problem in Websphere Test Environment
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   nehal_dave
Posted On:   Monday, March 18, 2002 10:40 AM

I am trying to access oracle 8i DB from my jsp page. I created a datsource sucessfully. But when i try to access it woth my jsp code it gives following error ... java.sql.SQLException: Error loading JDBC driver: oracle.jdbc.driver.OracleDriver Here is the code.. <%@ page language="java" import="java.sql.*,javax.sql.*,javax.naming.*"%> Context ctx = new InitialContext(); DataSource ds = (javax.sql.DataSource)ctx.lookup("jdbc/datasourcename"); con= ds.getConnection("username","password"); stmt=con.createStatement(); rs=stmt.executeQuery("select * from ta   More>>

I am trying to access oracle 8i DB from my jsp page. I created a datsource sucessfully. But when i try to access it woth my jsp code it gives following error ...


java.sql.SQLException: Error loading JDBC driver: oracle.jdbc.driver.OracleDriver


Here is the code..


<%@ page language="java" import="java.sql.*,javax.sql.*,javax.naming.*"%>


Context ctx = new InitialContext();


DataSource ds = (javax.sql.DataSource)ctx.lookup("jdbc/datasourcename");


con= ds.getConnection("username","password");


stmt=con.createStatement();


rs=stmt.executeQuery("select * from tab");


while(rs.next())


{


out.println(rs.getString(1));


}


}catch(Exception e)

{
out.println(e);
}


finally {

try {

if (rs != null) rs.close();

}

catch (java.sql.SQLException sqle) {

}

try {

if (stmt != null) stmt.close();
}
catch (java.sql.SQLException sqle) {

}

try {
if (con != null) con.close();
}
catch (SQLException sqle) {

}
}

can u suggest what is the problem. The classes12.zip is allready in classpath...

   <<Less

Re: Oracle Data source Problem in Websphere Test Environment

Posted By:   RaviKumar_Gopalankutty  
Posted On:   Thursday, April 25, 2002 08:57 AM

I am faced with the exact same problem as Nehal. Does anyone have a solutions to this problem? I am able to create the DataSource without issues. It is when the code is being run that I run into this problem. I have added the classpath in every plausible place inside the IDE. I even added a new project and imported the contents of the classes12.zip into the WorkSpace and added it to the Servlet Engine's classpath (using the WTE console).

The problem persists...

Re: Oracle Data source Problem in Websphere Test Environment

Posted By:   nehal_dave  
Posted On:   Monday, March 18, 2002 11:09 AM

Well I found out that while creating datasource in VAJ DataSource COnfiguration if the URL has an IP address (for e.g. 192.168.1.104) It dosnt work. As i had this machine on LAN I gave the machine name instead of IP address it worked....

that means

jdbc:oracle:thin:@192.168.1.104:1521:orcl dosnt work...

jdbc:oracle:thin:@oraDB:1521:orcl works..

why is it so???
About | Sitemap | Contact