AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: JDBC - AS/400 connection

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
Joseph Weinstein
Guest





PostPosted: Wed Jun 25, 2003 3:11 pm    Post subject: Re: JDBC - AS/400 connection Reply with quote





"心甜公子" wrote:

Quote:
I'm trying to connect AS/400 via JDBC in a jsp file, but I tried many times,
it
still give me an error message of
"javax.servlet.ServletException: No suitable driver"

I'd downloaded the JDBC driver jt400.jar and put it into the directory C:
jdk131lib and added the path in the environment classpath ";C:
jdk131libjt400.jar". But it still said "No suitable driver", I just
don't
know why. Could anyone give me some hints for how to solve this problem?
Thank
you very much !

The fact that your 'registerDriver' call succeeded means the classpath is OK.
The exception you get is telling me that the URL you supplied is not what
the AS400 driver expects. Do this:

Driver d = new com.ibm.as400.access.AS400JDBCDriver();
System.out.println("Is this URL acceptible? " +
d.acceptsURL("jdbc:as400//mysystem;naming=sql;errors=full") );

Joe Weinstein at BEA

Quote:


I'm using JDK1.31 with Tomcat 3.2.3

The following is the beginning of the jsp code:

%@ page contentType="text/html"
import="java.sql.*"
%

%

DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());

Connection con = DriverManager.getConnection
("jdbc:as400//mysystem;naming=sql;errors=full","userid","password");

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("SELECT * FROM USER_PROFILE");

%


Back to top
Stubber1960
Guest





PostPosted: Wed Jun 25, 2003 4:37 pm    Post subject: Re: JDBC - AS/400 connection Reply with quote



Quote:
I'm trying to connect AS/400 via JDBC in a jsp file, but I tried many
times,
it still give me an error message of "javax.servlet.ServletException: No
suitable driver"

I'd downloaded the JDBC driver jt400.jar and put it into the directory C:
jdk131lib and added the path in the environment classpath ";C:
jdk131libjt400.jar". But it still said "No suitable driver", I just
don't know why. Could anyone give me some hints for how to solve this
problem?
Thank you very much !

I'm using JDK1.31 with Tomcat 3.2.3

The following is the beginning of the jsp code:

%@ page contentType="text/html"
import="java.sql.*"
%

%

DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
Connection con = DriverManager.getConnection
("jdbc:as400//mysystem;naming=sql;errors=full","userid","password");

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("SELECT * FROM USER_PROFILE");

%


I believe you are missing a colon after the as400 in the URL. Should be
"jdbc:as400://mysystem..."



Back to top
Blue Jean
Guest





PostPosted: Wed Jun 25, 2003 7:35 pm    Post subject: Re: JDBC - AS/400 connection Reply with quote



But the question is whether or not the system classpath is used
by your jsp at all, print out the classpath there and you'll see.

-S.
______________
Bugzero all-in-one: bug tracking & help desk
Free try: http://www.websina.com/bugzero/



"心甜公子" <心甜公子 (AT) hotmail (DOT) com> wrote

Quote:
I'm trying to connect AS/400 via JDBC in a jsp file, but I tried many times,
it
still give me an error message of
"javax.servlet.ServletException: No suitable driver"

I'd downloaded the JDBC driver jt400.jar and put it into the directory C:
jdk131lib and added the path in the environment classpath ";C:
jdk131libjt400.jar". But it still said "No suitable driver", I just
don't
know why. Could anyone give me some hints for how to solve this problem?
Thank
you very much !

I'm using JDK1.31 with Tomcat 3.2.3


The following is the beginning of the jsp code:

%@ page contentType="text/html"
import="java.sql.*"
%

%

DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());


Connection con = DriverManager.getConnection
("jdbc:as400//mysystem;naming=sql;errors=full","userid","password");

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("SELECT * FROM USER_PROFILE");

%

Back to top
Jean-Daniel Bonatout
Guest





PostPosted: Mon Jun 30, 2003 9:29 pm    Post subject: Re: JDBC - AS/400 connection Reply with quote

Hello,
You say you're working with Tomcat. Shouldn't you better put your library,
your jar file, in {Tomcat}/common/lib ?
HTH
----
jd bonatout
----
Quote:
I'm trying to connect AS/400 via JDBC in a jsp file, but I tried many
times,
it
still give me an error message of
"javax.servlet.ServletException: No suitable driver"

I'd downloaded the JDBC driver jt400.jar and put it into the directory C:
jdk131lib and added the path in the environment classpath ";C:
jdk131libjt400.jar". But it still said "No suitable driver", I just
don't
know why. Could anyone give me some hints for how to solve this problem?
Thank
you very much !

I'm using JDK1.31 with Tomcat 3.2.3


The following is the beginning of the jsp code:

%@ page contentType="text/html"
import="java.sql.*"
%

%

DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());


Connection con = DriverManager.getConnection
("jdbc:as400//mysystem;naming=sql;errors=full","userid","password");

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("SELECT * FROM USER_PROFILE");

%





Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.