Via  www.jdbc-tutorial.com, I was able to get past the IDE error by
putting the a try/catch around the Class.forName.

Now I am working on...

        java.sql.SQLException: UniVerse/SQL: Unable to attach to
directory "u2/SANDBOX".

--Bill

*-----------------------------------------------------------------------
------------------------------------------------------------------------


import java.sql.*;

public class Uni_101 {

    public static void main(String[] args) {
        try {
            String userid    = "ups";
            String passWord  = "brown";

            String url = "jdbc:ibm-u2://192.168.0.102/u2/SANDBOX/";

            try {
                Class.forName("com.ibm.u2.jdbc.UniJDBCDriver"); 
            }
            catch(Exception x){
                System.out.println( "Here " + x );
            }         
        
            Connection con = DriverManager.getConnection(url, userid,
passWord);
 
            Statement stmt = con.createStatement();
//          String sql = "SELECT @ID FROM PACKSLIPS.X";
            String sql = "LIST PACKSLIPS.X";
            ResultSet rs = stmt.executeQuery(sql);
            System.out.println(rs);
        }
        catch (SQLException e ) {
            System.out.println(e);
        }
    }

}

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to