Hi,

You can use AS400 Toolbox for Java, supplied by IBM.  I am working with
AS400 Toolbox for Java since one year.  I can help you, ask me your doubts.


Take the following example:





import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.io.*;
import com.ibm.as400.access.*;

public class as400db extends HttpServlet{

 public void service (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
    {

     res.setContentType("text/html");
     PrintWriter out = res.getWriter();



Connection con = null;
Statement st = null;
ResultSet rs = null;

out.println("<html><body>");
out.println("Hello");



        try


            java.sql.DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver());// registers the driver which will
be used for the jdbc operation
         Class.forName("com.ibm.as400.access.AS400JDBCDriver");//an entry
for the class is made

con=DriverManager.getConnection("Jdbc:as400://10.100.11.20");//connection
with the database is done

  }
  catch(Exception e)
        {System.out.println("excep :"+e);
 out.println("error :"+e);
        }
 try{
st = con.createStatement();
rs = st.executeQuery("select * from qgpl.temp");
rs.next();
out.println("from bd2 :"+rs.getObject(1).toString());

 }catch(Exception e)
        {System.out.println("excep st:"+e);
 out.println("error st:"+e);
        }

out.println("</body></html>");

}//service
}//class




Yours,

Chandrasekhar Naidu,
Sr. Software Engineer,
Oasys Technologies,
Bangalore,
India.
Phone : 91 80 2280523/4/5/6





----- Original Message -----
From: Rahul Dwivedi <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 02, 1999 8:59 AM
Subject: Re: java.sql.SQLException: Error !!!!


> even i was getting this problem when i was trying to run a pgm which uses
> jdbc-odbc connection. i don't know the exact sol. for it but  for as400 i
> think as400 toolbox specific classes can be used by creating a as400
object
> and acess jdbc-db2 connection.
>
> i still want to know why this error ... while using jdbc odbc connection.
>
> Rahul
>
>
>
>
>
> Hiten Shah <[EMAIL PROTECTED]> on 09/01/99 06:42:27 PM
>
> Please respond to [EMAIL PROTECTED]
>
> To:   [EMAIL PROTECTED]
> cc:    (bcc: Rahul Dwivedi/LTITLVSH)
>
> Subject:  java.sql.SQLException:  Error !!!!
>
>
>
>
> dear all,
>
> i am getting this error when i trying to connect to backhand.
> i am using db2 as back hand. ODBC is working fine.
> but JDBC-ODBC connectivity is creating problem.
>
> i am getting the following error :
> "java.sql.SQLException: Specified driver could not be loaded due to system
> error 126 (IBM DB2 ODBC DRIVER). "
>
> if anyone could figure out, do reply asap...
> this is on highest priority...
>
> TIA
>
> regards
> hiten
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to