 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
JT Guest
|
Posted: Wed Sep 06, 2006 8:12 pm Post subject: Netbeans and Datasources |
|
|
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:oracle:thin:myname/mypass (AT) 192 (DOT) 168.1.231: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:oracle:thin: ....
Thanks |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|