Advertisement

11.10.2008 at 08:38AM PST, ID: 23891338 | Points: 125
[x]
Attachment Details

Connecting to the AS400

I am trying to create a test connection using jsp.

I am getting a blank page with ERROR: com.ibm.as400.access.AS400JDBCDriver  at the top.  (It's from the catch block of the try..catch.)  

I have copied the jt400.jar to my PC and added it to the classpath.  Is there something on the iSeries that needs opeinging or something?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
<%
        
        try 
        {
            Class.forName("com.ibm.as400.access.AS400JDBCDriver").newInstance();
 
            //DriverManager.registerDriver(new com.ibm.as400.app.DB2Driver()); 
            //Class.forName("com.ibm.db2.jdbc.app.DB2Driver");
            
            Connection conn =
            DriverManager.getConnection("jdbc:as400://jde","uname", "psswd");
            
            out.print("<table border='1'>");
            out.print("<th>ID</th><th>Login</th><th>Description</th>");
 
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("SELECT * from bviprod.F0101 where aban8 = '1'");
 
            while (rs.next())
            {
 
            String userID = rs.getString("ABAN8");
            String userLogin = rs.getString("ABALPH");
            String userDesc = rs.getString("ABDC");
 
            out.print("<tr>");
            out.print("<td>" + userID + "</td>");
            out.print("<td>" + userLogin + "</td>");
            out.print("<td>" + userDesc + "</td>");
 
            out.print("</tr>");
 
            }
            out.print("</table>");
            conn.close();
        }
        catch (Exception e) 
        {
            // If any of the above operations failed then print error message
            //out.print ("\nError in setConnection");
            out.print ("ERROR: " + e.getMessage());
            //out.print ("\nTerminating program");
            //System.exit(1);
        }
        
        
 
    %>
Top Expert: mrcoffee365
Expert Since: 04/27/2004
Accepted Solutions: 514
Computer Expertise: Advanced
mrcoffee365 has been an Expert for 4 years 8 months, during which he has posted 1959 comments and answered 514 questions. mrcoffee365 is just one of 139 experts in the Programming for iSeries / AS400 Zone.
 
 
20081119-EE-VQP-47 - Hierarchy / EE_QW_2_20070628