Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / June 2003

Tip: Looking for answers? Try searching our database.

JDBC - AS/400 connection

Thread view: 
???????l - 25 Jun 2003 14:15 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 !

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]
>
> %


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.