Rob,
It didn't work out :-(. I got the same error message:
Exception in thread "main"
COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI
0615E Error receiving from socket, server is not
responding. SQLSTATE=08S01
at
COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throwReceiveError(SQLExcep
tionGenerator.java:437)
at
COM.ibm.db2.jdbc.net.DB2Request.receive(DB2Request.java:703)
at
COM.ibm.db2.jdbc.net.DB2Request.sendAndRecv(DB2Request.java:563)
at
COM.ibm.db2.jdbc.net.DB2Connection.SQLConnect(DB2Connection.java:326)
at
COM.ibm.db2.jdbc.net.DB2Connection.SQLConnect(DB2Connection.java:288)
at
COM.ibm.db2.jdbc.net.DB2Connection.create(DB2Connection.java:273)
at
COM.ibm.db2.jdbc.net.DB2Connection.<init>(DB2Connection.java:198)
at
COM.ibm.db2.jdbc.net.DB2Driver.connect(DB2Driver.java:215)
at
SQuirreLConnectTest.getConnection(SQuirreLConnectTest.java:48)
at
SQuirreLConnectTest.main(SQuirreLConnectTest.java:21)
Are you really sure that it's possible to connect to a
database in a mainframe?
I'm thinking of trying to access the database via
JDBC-ODBC bridge... Do you know where can I get a
JDBC-ODBC bridge driver?
Thanks,
Mateus Ribeiro
--- Rob Manning <Rob...@co...>
wrote:
> Mateus F. Ribeiro wrote:
>
> >Hello!
> >
> >I'm getting an error message when trying to connect
> to
> >a MVS (mainframe) DB2 database. The database's OS
> is
> >the OS/390 7.1.2. (I believe so).
> >
> >
> Mateus,
>
> Please compile and run the attached application. It
> very simply
> connects to the
> database you specify with command-line arguments.
> It does so in the same
> manner as SQuirreL. It was contributed by Gerd
> Wagner to help us isolate
> connectivity issues. If you can connect, then try
> using the same
> settings inSQuirreL. If you cannot, hen it's a
> problem with your
> configuration / server / network / driver or some
> combination that will
> make it
> difficult for us to help you. Let us know how it
> goes.
>
> Rob Manning
> > package net.sourceforge.squirrel_sql.test;
>
> import java.sql.Connection;
> import java.sql.Driver;
> import java.sql.SQLException;
> import java.util.Properties;
>
> public class SQuirreLConnectTest {
>
> public static void main(String[] args)
> throws Exception
> {
> if (args.length < 4) {
> printUsage();
> }
> String driver = args[0];
> String url = args[1];
> String user = args[2];
> String pass = args[3];
>
> Connection connection =
> getConnection(driver, url, user, pass, null);
>
> System.out.println("Connected to: " +
> connection.getMetaData().getURL());
> }
>
> private static void printUsage() {
> System.out.println("SQuirreLConnectTest:
> <driver> <url> <user> <pass>");
> System.exit(-1);
> }
>
> /**
> * @param props
> * may be null
> */
> public static Connection getConnection(String
> driver, String url,
> String user, String pw, Properties
> props)
> throws ClassNotFoundException,
> IllegalAccessException,
> InstantiationException, SQLException {
> if (null == props) {
> props = new Properties();
> }
>
> props.put("user", user);
> props.put("password", pw);
>
> Driver driverInst = (Driver)
> Class.forName(driver).newInstance();
>
> Connection jdbcConn =
> driverInst.connect(url, props);
> if (jdbcConn == null) {
> throw new RuntimeException("Connect
> failed");
> }
>
> return jdbcConn;
> }
> }
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|