 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Joseph Weinstein Guest
|
Posted: Wed Jun 25, 2003 3:11 pm Post subject: Re: JDBC - AS/400 connection |
|
|
"心甜公子" 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
|
Posted: Wed Jun 25, 2003 4:37 pm Post subject: Re: JDBC - AS/400 connection |
|
|
| 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
|
Posted: Wed Jun 25, 2003 7:35 pm Post subject: Re: JDBC - AS/400 connection |
|
|
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
|
Posted: Mon Jun 30, 2003 9:29 pm Post subject: Re: JDBC - AS/400 connection |
|
|
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 |
|
 |
|
|
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
|
|