I'm having a problem using the AS400 JDBC driver included with the toolbox.
When trying to get a connection the following exception is thrown: The
application requester cannot establish the connection. Have you seen this
before? Can you point me in the right direction? Much thanks in advance.
Harry Lamlin
A code snippet is below.
public void focusLost(FocusEvent e) {
String sqlString = "Select * From Swcrlstdd.MTabel1 Where " +
"TBCDCP = '" + txtCompany.getText() + "'" +
" And TBCDSY = '" + txtSystem.getText() + "'" +
" And TBCDTB = '" + txtTable.getText() + "'" ;
try {
// Register the driver and get a connection.
DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver());
Connection c = DriverManager.getConnection
("jdbc:as400://ROH054"); <==== This doesn't work
// String dbUrl = "jdbc:odbc:myTestDBox"; // Configured data source
// String dbUser = "XXXXXX";
// String dbPwd = "XXXXXX";
// Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// Connection c = DriverManager.getConnection(dbUrl, dbUser, dbPwd);
<======= This works !
Statement s = c.createStatement ();
ResultSet rs = s.executeQuery(sqlString);
while (rs.next ())
chcElements.addItem(rs.getString("Tbcdel"));
} catch (Exception ex) {
System.out.println ("ERROR: " + ex.getMessage());
}
}
plenty of java gurus there.
good luck!
mel anderson
ibm rochester
**opinions expressed are not necessarily those of my employer.**
This message means the JDBC driver is unable to contact your AS/400. It could be
one of several things:
1. The IP Address you defined for the AS/400 is incorrect. Make sure the IP
Address is correct and you can successfully "ping" the IP from a DOS prompt.
2. The Host Name is incorrect or cannot be resolved on your client PC. Make sure
the Host Name is correct and you can successfully "ping" the Host Name from a
DOS prompt.
3. The OS/400 servers need to be started. Issue the command "STRHOSTSVR *ALL"
from a command prompt. If not already started, run "STRSBS QSERVER" from an
AS/400 command prompt to start the QSERVER subsystem before starting the
servers.
If these three steps don't fix the problem, check to see if there's a QZDASOINIT
job running in QSERVER (use WRKSBSJOB QSERVER). If not, its possible the
QZDASOINIT prestart job is ending abnormally. Here's one possible reason for
this happening:
"The problem was with the QUSER profile. It had a max storage limit of about
12000kb which prevented the prestart jobs from building a logical over the
QAZDGCOL file in QSYS. Setting this to *NOMAX solved the problem."
I compiled this list to help users evaluating a new utility I helped write
called Surveyor/400. It's a Java based GUI explorer for the AS/400. It's pretty
slick, I think. You can download a thirty day evaluation from
http://www.linomasoftware.com.
I hope this helps.
Brad Grier
Linoma Software