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:
\jdk131\lib\ and added the path in the environment classpath ";C:
\jdk131\lib\jt400.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");
%
Joseph Weinstein - 25 Jun 2003 16:11 GMT
"¤ß²¢¤½¤l" wrote:
> I'm trying to connect AS/400 via JDBC in a jsp file, but I tried many times,
> it
[quoted text clipped - 8 lines]
> 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
> I'm using JDK1.31 with Tomcat 3.2.3
>
[quoted text clipped - 16 lines]
>
> %
Stubber1960 - 25 Jun 2003 17:37 GMT
> 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:
> \jdk131\lib\ and added the path in the environment classpath ";C:
> \jdk131\lib\jt400.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 !
>
[quoted text clipped - 17 lines]
>
> %>
I believe you are missing a colon after the as400 in the URL. Should be
"jdbc:as400://mysystem..."
Blue Jean - 25 Jun 2003 20:35 GMT
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/
"¤ß²¢¤½¤l" <¤ß²¢¤½¤l@hotmail.com> wrote in message news:<bdc790$jts69@imsp212.netvigator.com>...
> I'm trying to connect AS/400 via JDBC in a jsp file, but I tried many times,
> it
[quoted text clipped - 29 lines]
>
> %
Jean-Daniel Bonatout - 30 Jun 2003 22:29 GMT
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
----
> I'm trying to connect AS/400 via JDBC in a jsp file, but I tried many times,
> it
[quoted text clipped - 29 lines]
>
> %