Netbeans and Datasources

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:eek: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:eek:racle:thin: ....

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top