J
JT
I am using netbeans 5.0 ide. I am running everything on the tomcat
bundled with Netbeans5.0 in test mode. I setup a resource name in the
project context.xml as such:
<Context path="/WebApplication1" debug="5" reloadable="true"
crossContext="true">
<Resource name="jdbc/MYSID" auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="mypass" password="mypass123"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc
racle:thin:myname/[email protected]:1521:mysid"/>
</Context>
My servlet is as such:
Context initContext = new InitialContext();
Context envContext =
(Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/MYSID");
conn = ds.getConnection();
....
I loaded the oracle class12.jar as a lib in the Libraries section.
When I run the servlet I get:
State : null
Message: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
Error : 0
Although the servlet works when I access jdbc direct without using a
"datasource":
//Class.forName("oracle.jdbc.driver.OracleDriver" ).newInstance() ;
//Get a connection to the database
//conn = DriverManager.getConnection( "jdbc
racle:thin: ....
Thanks
bundled with Netbeans5.0 in test mode. I setup a resource name in the
project context.xml as such:
<Context path="/WebApplication1" debug="5" reloadable="true"
crossContext="true">
<Resource name="jdbc/MYSID" auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="mypass" password="mypass123"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc
</Context>
My servlet is as such:
Context initContext = new InitialContext();
Context envContext =
(Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/MYSID");
conn = ds.getConnection();
....
I loaded the oracle class12.jar as a lib in the Libraries section.
When I run the servlet I get:
State : null
Message: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
Error : 0
Although the servlet works when I access jdbc direct without using a
"datasource":
//Class.forName("oracle.jdbc.driver.OracleDriver" ).newInstance() ;
//Get a connection to the database
//conn = DriverManager.getConnection( "jdbc
Thanks