Win a copy of liveProject: Build an ML Recommender System this week in the Artificial Intelligence and Machine Learning forum!

Preity crazy

Greenhorn
+ Follow
since Feb 23, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Preity crazy

Hi Frenz,

Sorry for troubling you all.What to do,No other way for me.Inspite of my hard trials for Tomcat5.5.7 i couldn't get the desired results.

My DSN,driver etc are working fine with normal JDBC programs,Web server but i dunno y its not working with Tomcat alone.

I am using the following 3 statements with the normal JDBC programs(not servlets)

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con = DriverManager.getConnection("jdbc dbc:S2Tech","scott","tiger");

Statement stmt = con.createStatement();

I tried even with jndi lookup as i mentioned in my earlier posts.Then i thought may be driver is the problem. I downloaded OJDBC14.jar and tried again. But of no use. Now i feel like uninstalling Tomcat 5.5.7 and go for Tomcat4.x. But before going for that can sumone find or fix my problem.

I will be very thankful to you all. Thanks in advance.
16 years ago
Thanx a lot for all your co-operation friends. Now i found the problem finally.I have a thin driver for JDk1.2 and JDK 1.3 which is not compatible with JDK1.5.. So it seems because of this after all the modifications iam getting Driver not found.

Can anyone of you help me in getting Oracle thin driver for JDK1.5.Pleaseeeeeeee

Thanx in advance:-)
16 years ago
Hi friends,

Still i couldn't solve my problem.Now my error message is changed to:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

Rahul-What is that you are saying about OJDBC14.I couldn't find it.Can you please tell me where it is.

Rajendar-For the first method i got the following message:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

But after doing the following changes i got the below message:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

Sandip- I followed your second method.But still getiing error as i mentioned. :-(


Friends,

I have JDK1.5,Tomcat5.5.7,Oracle 9i and on windows 2000. Can someone solve my problem please.Actually i can run my programs without any changes on webserver.But I need the same on tomcat.So please i require all your help.

I did the following things.Correct me if i did any mistake anywhere.

1.I copied classes12.jar file into TOMCAT_HOME/commom/lib folder

2.I configured my DSN as "S2Tech" thru control panel

3.I included the following in my TOMCAT_HOME/conf/server.xml

<Context>
<Resource name="jdbc/S2Tech" auth="Container"
type="javax.sql.DataSource" description="User database that can be updated and saved"
username="scott" password="tiger" driverClassName="oracle.jdbc.OracleDriver" url="jdbc racle:thin@localhost:1521:S2Tech" />
</Context>

4.I included the following in my TOMCAT_HOME/webapps/servlets-examples/WEB-INF/web.XML

<resource-ref>
<description> Resource Reference </description>
<res-ref-name> jdbc/S2Tech </res-ref-name>
<res-type> javax.sql.DataSource </res-type>
<res-auth> Container </res-auth>
</resource-ref>


5.The following code i used in my servlet program:

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");

// Look up our data source
DataSource ds = (DataSource) envCtx.lookup("jdbc/S2Tech");

// Allocate and use a connection from the pool
Connection con = ds.getConnection("scott","tiger");


Thanks a lot for all your help in advance.
16 years ago
Thankyou Sandip,

I already used the first way you suggested but in different way.It didn't work.Just see the code :



So now i am trying with the second way which you have given.I will let you know the result.
16 years ago
Hi Sandip,

My database is oracle 9i client.I am using sun.jdbc.odbc driver.I have a dsn configured thru control panel. Still it is saying DSn name not found.

Thanks in advance.
16 years ago
Thanks Rajendar.

So i added classes12.jar file in tomcat common/lib.
Then i added the following code to the context:::

<Resource name="jdbc/S2Tech" auth="Container" type="javax.sql.DataSource" username="scott" password="tiger" driverClassName="org.hsql.jdbcDriver" url="jdbc:HypersonicSQL atabase"
maxActive="8" maxIdle="4"/>

S2Tech is my DSN name,but i am not sure about the driverclassname and URL.I have to check that.ours is not hypersonic Sql

Will this be enough rajendar or i need to do something else also.And in the servlet program instead of the below code i think i need to change my code right!

[CODE}
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc :-o dbc:S2Tech","scott","tiger");
Statement stmt = con.createStatement();
[/CODE]
16 years ago
Hi Sandip,

Thanx for the quick reply. Actually i went thru that document before itself,but i got confused with JNDI.Please tell me if my understanding is correct:

Should i modify server.Xml in the following place:

<GlobalNamingResources>
- <!-- Test entry for demonstration purposes
-->
<Environment name="simpleValue" type="java.lang.Integer" value="30" />
- <!--
Editable user database that can also be used by
UserDatabaseRealm to authenticate users

-->
<Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" />
</GlobalNamingResources

I am new to this tomcat server.So can you please explain me in detail sandip.

And there are so many lib folders in Tomcat ,where exactly i should keep classes12.jar file
16 years ago
Hi Friends,

I am using Tomcat5.5.7 version and oracle as my back end connectivity.And my jdk is jdk1.5. Everything is fine till servlets. But when iam running servlets in tomcat with JDBC i got the following error:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

These are the JDBC connectivity statements i used:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc dbc:S2Tech","scott","tiger");
Statement stmt = con.createStatement();

My DSN is configured as S2Tech.I dont know why i am getting this error. Should i do any modifications in server.xml.Could someone please help me in this issue.

Thanks in advance,
Preity

PS:When i ran same program in webserver it's working fine.
16 years ago