JDBC Connection from JAVA to iSeries DB

115 pts.
IBM Rational
Java Database
I have a simple class that resides on my local drive. I am attempting to connect to iSeries I5V4 environment and do "select" from one of the DB files. When I run my .class file in Rational Application Development I ghet a "class not found" exception. How do I set classpath in RAD? Should my application (java class file) reside on IFS ? What should the classpath be ? New to Java... Any feedback is greatly appreciated

Answer Wiki

Thanks. We'll let you know when a new response is added.


If your class file is in your local PC and using RAD java perspective, you can run your class.

RAD’s java perspective is a Java SE development tool, you don’t need to set the class path in general.

Do you have your java project setup in RAD ? Are you calling your java class from java project?

in COM statement error is occurred. so what can i do?

Discuss This Question: 1  Reply

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Paulsundarsingh
    package COM.ibm.db2.jdbc.app; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.*; import javax.sql.*; import COM.ibm.db2.jdbc.app.DB2Driver; public interface DB2Driver { } public static void main(String[string] args) { try { Class.forName("COM.ibm.db2.jcc.DB2Driver"); Connection db2Conn = DriverManager.getConnection("jdbc:db2:empdetails","db2admin","db2admin"); Statement st = db2Conn.createStatement(); String myQuery = "SELECT * FROM empdetails"; ResultSet resultSet = st.executeQuery(myQuery); while (resultSet.next()) { String name = resultSet.getString("name"); String age = resultSet.getString("age"); System.out.println("Name: " + name); System.out.println("Age: " + age); System.out.println("-------------------------------"); } resultSet.close(); st.close(); db2Conn.close(); } catch (ClassNotFoundException cnfe) { cnfe.printStackTrace(); } catch (SQLException sqle) { sqle.printStackTrace(); } } this is my pgm. but error is occurred in [COM & main function] so what can i do? plz help me.
    40 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: