File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Problem in database connectivity in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem in database connectivity in JSP" Watch "Problem in database connectivity in JSP" New topic
Author

Problem in database connectivity in JSP

jeyaveera pandian
Ranch Hand

Joined: Sep 29, 2000
Posts: 39
Hi friends,
I came across a problec while I tried to connect with the database from JSP. That is I wrote like
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
It shows errors as the two integer arguments are not valid. How to solve this? Plz help me.
Thanks in advance
Anbudan
K.Jeyaveerapandian
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
It looks like the JDBC driver you are using does not support that method. Note that JDBC 1.0, as supported by many drivers, only supports a no-argument createStatement() call. The createStatement call taking two integer parameters was only introduced in JDBC 1.2. You can see the JavaDoc here.
Can you tell us which driver version you are using and which database you are trying to access?

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
jeyaveera pandian
Ranch Hand

Joined: Sep 29, 2000
Posts: 39
Hi Carvar,
Thanks alot for your answer. But still I am having problems. That is I dont know what version of driver i am using. Please tell me what things should i do if i want to use jdbc 1.2? Now I wrote the program for the MS-Access database. But I want to switch over to Oracle. About the driver in my code I wtote like this,
Connection con= DriverManager.getConnection("jdbc dbc:myDSN");
Please help as I am in urgent need,
Thanks in advance,
Anbudan,
K.Jeyaveerapandian
Edgar Sanchez
Greenhorn

Joined: Oct 12, 2000
Posts: 21
Could you tell us the JDK version you are using and the servlet processor you are using (Tomcat, Resin, Oracle iAS, etc.)
Best luck,
Edgar S´┐Żnchez

Originally posted by jeyaveera pandian:
Hi Carvar,
Thanks alot for your answer. But still I am having problems. That is I dont know what version of driver i am using. Please tell me what things should i do if i want to use jdbc 1.2? Now I wrote the program for the MS-Access database. But I want to switch over to Oracle. About the driver in my code I wtote like this,
Connection con= DriverManager.getConnection("jdbc dbc:myDSN");
Please help as I am in urgent need,
Thanks in advance,
Anbudan,
K.Jeyaveerapandian

Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I thought that might be the case. You are using the JDBC-ODBC bridge, which is generally regareded as being a rather weak implementation of an old JDBC version. If you are using, or planning to use, a modern, supported database such as Oracle, you really should get the latest JDBC driver from the database vendor. Oracle provide a JDBC 1.2 driver implementaion with the name "classes12_01.zip". You may already have it.
jeyaveera pandian
Ranch Hand

Joined: Sep 29, 2000
Posts: 39
Hi Edgar,
Thanks for your answer. I am using the JDK1.3 version and I am using the JWS. Now I am interested in using Weblogic Server. So please tell me suggestions fot that also.
Then this is for Carver. I thank you also. What to do with that "classes12_01.zip" to make my code run well. Plz reply me soon
Anbudan
K.Jeyaveerapandian
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in database connectivity in JSP