You can use the Java Tool Box from IBM, there is special classess to manage
connections with the AS/400, also it include a JDBC driver for the AS400:

import com.sun.java.swing.*;
import java.awt.*;
import java.sql.*;
import com.ibm.as400.vaccess.SQLResultSetTableModel;
import com.ibm.as400.vaccess.SQLResultSetTablePane;
import com.ibm.as400.vaccess.SQLConnection;
import com.ibm.as400.access.AS400JDBCPreparedStatement;

public class JApplet1 extends JApplet
{
        public void init()
        {
                symantec.itools.lang.Context.setApplet(this);
                
        
getRootPane().putClientProperty("defeatSystemEventQueueCheck",
Boolean.TRUE);
                
                getContentPane().setLayout(null);
                setSize(760,400);
                Cliente.setText("001288075060969");
                getContentPane().add(Cliente);
                Cliente.setBounds(60,36,108,24);
                Fecha.setText("990903");
                getContentPane().add(Fecha);
                Fecha.setBounds(60,60,107,20);
                try {
                        Grid.setConnection(SQL1);
                }
                catch(java.beans.PropertyVetoException e) { }
                getContentPane().add(Grid);
                Grid.setBounds(192,60,396,308);
                try {
                        SQL1.setURL("jdbc:as400://S1031MMM");
                        
                }
                catch(java.beans.PropertyVetoException e) { }
                try{
                    DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver ());
                 SQL1.getConnection();   
                }catch(Exception e){}
                try{
                Grid.setQuery("SELECT dlbpc, dlmsq, ddfcs, ddrqf, ddrqt,
ddrqq, ddsdt, ddedt FROM   "
                         +   "   bpcsfl.tdlb, bpcsfl.tddb WHERE dLDTD =
'ECM' and dlmsq = ddmsq and " 
                 +   "   dlgui = ddgui and DLGUI in ( SELECT dogui FROM
" 
                 +   "   bpcsfl.tdob WHERE DOSID = '099822033' and SUBSTR(
DOGUI ,1,6)" 
                 +   "   = '990910' ) ORDER BY dlmsq");
                Grid.load();
                }catch (Exception e) {}

        }

        //{{DECLARE_CONTROLS
        com.sun.java.swing.JTextField Cliente = new
com.sun.java.swing.JTextField();
        com.sun.java.swing.JTextField Fecha = new
com.sun.java.swing.JTextField();
        com.ibm.as400.vaccess.SQLResultSetTablePane Grid = new
com.ibm.as400.vaccess.SQLResultSetTablePane();
        com.ibm.as400.vaccess.SQLConnection SQL1 = new
com.ibm.as400.vaccess.SQLConnection();
        //}}
}

> -----Original Message-----
> From: Barla Ramesh Reddy, Gurgaon [SMTP:RAMESH@ggn.hcltech.com]
> Sent: Wednesday, September 22, 1999 1:08 PM
> To:   JAVA400-L@midrange.com
> Subject:      RE: help with applets...
> 
> Hi Guys and Gals,
> I am unable to coonect As/400 databe.Here my problem is to get data from
> As/400 machine. I have written the code in JDK. It is compiled.I am
> getting
> error during runtime. Here I am attaching the Applet.
>  <<jdb.java>> 
> Here I am using the table which is having two fields only(it is from
> DB2/400)
> In the program table is referred by rameshlib.ram(ram is the table and
> rameshlib is the Library in the AS/400).
> Let me know what is the wrong with Program?
> 
> Thanks,
> Ramesh
> HCL Technologies India Pvt. Ltd. ,Gurgaon,aryana-122016
> E-mail : ramesh@ggn.hcltech.com
>  << File: jdb.java >> 
+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.