Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNDI: Tomcat + Oracle

Reply
Thread Tools

JNDI: Tomcat + Oracle

 
 
cccc
Guest
Posts: n/a
 
      05-13-2004
Hi,
I try this exercise: JNDI in Tomcat + Oracle bad this non work.

1/3)
I copy a file ojdbc14.jar in /common/lib Tomcat folder

2/3)
I write in server.xml Tomcat file:
.....
.....
<Resource name="jdbc/Test" type="javax.sql.DataSource" scope= "Shareable"
auth="Container"/>
<ResourceParams name="jdbc/Test">
<parameter>
<name>user</name>
<value>oe</value>
</parameter>
<parameter>
<name>password</name>
<value>adminoe</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbcracle:thin:@192.168.1.100:1521:MYDB </value>
</parameter>
<parameter>
<name>maxActive</name>
<value>15</value>
</parameter>
<parameter><name>maxIdle</name>
<value>15</value>
</parameter>
</ResourceParams>
.....
.....

3/3)
I write in my java code:
.....
javax.naming.Context initContext = new javax.naming.InitialContext();
javax.naming.Context envContext =
(javax.naming.Context)initContext.lookup("java:/comp/env");
javax.sql.DataSource ds = (javax.sql.DataSource)
envContext.lookup("jdbc/Test");;
Connection conn = ds.getConnection();
.....

This is the message error:
java.sql.SQLException: No suitable driver


I need your help?

Thank you,
CC






 
Reply With Quote
 
 
 
 
Igor N. Kolomiyets
Guest
Posts: n/a
 
      05-13-2004
The Oracle driver is oracle.jdbc.OracleDriver, not a
oracle.jdbc.driver.OracleDriver.

cccc wrote:
> Hi,
> I try this exercise: JNDI in Tomcat + Oracle bad this non work.
>
> 1/3)
> I copy a file ojdbc14.jar in /common/lib Tomcat folder
>
> 2/3)
> I write in server.xml Tomcat file:
> ....
> ....
> <Resource name="jdbc/Test" type="javax.sql.DataSource" scope= "Shareable"
> auth="Container"/>
> <ResourceParams name="jdbc/Test">
> <parameter>
> <name>user</name>
> <value>oe</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>adminoe</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>oracle.jdbc.driver.OracleDriver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbcracle:thin:@192.168.1.100:1521:MYDB </value>
> </parameter>
> <parameter>
> <name>maxActive</name>
> <value>15</value>
> </parameter>
> <parameter><name>maxIdle</name>
> <value>15</value>
> </parameter>
> </ResourceParams>
> ....
> ....
>
> 3/3)
> I write in my java code:
> ....
> javax.naming.Context initContext = new javax.naming.InitialContext();
> javax.naming.Context envContext =
> (javax.naming.Context)initContext.lookup("java:/comp/env");
> javax.sql.DataSource ds = (javax.sql.DataSource)
> envContext.lookup("jdbc/Test");;
> Connection conn = ds.getConnection();
> ....
>
> This is the message error:
> java.sql.SQLException: No suitable driver
>
>
> I need your help?
>
> Thank you,
> CC
>
>
>
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM
Exception thrown while accessing Oracle through oracle client =?Utf-8?B?TmVv?= ASP .Net 2 07-12-2005 06:59 PM
Oracle adapter don't work with Oracle 10.1.0.2 v. Client vaidas gudas ASP .Net 1 10-11-2004 01:11 PM
Re: Error Connecting to Oracle after an Oracle shutdown David Rudder Java 0 07-30-2003 01:22 PM
Re: Error Connecting to Oracle after an Oracle shutdown Juha Laiho Java 0 07-30-2003 10:22 AM



Advertisments