Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

getConnection

3 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-07-17 12:48:23.0Z
Gene Dubetskiy Posted on 1997-07-16 22:57:09.0Z
Message-ID: <33CD51C5.26ED@tudor.com>
Date: Wed, 16 Jul 1997 18:57:09 -0400
From: Gene Dubetskiy <dgene@tudor.com>
Reply-To: dgene@tudor.com
Organization: Tudor Investment Co.
X-Mailer: Mozilla 3.0Gold (WinNT; I)
MIME-Version: 1.0
CC: dgene@tudor.com, randall@tudor.com
Subject: getConnection
Content-Type: multipart/mixed; boundary="------------2C0E65821378"
Newsgroups: sybase.public.jdbcconnect
Lines: 161
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:529
Article PK: 252281

Hi,
I'm using Sun Solaris, JDK1.1.3. These are the java file and it's
output. I've tried to telnet to the server port I'm using in the
program and it works, isql works with the user and the password.
Why am I geting this message?

Gene

// Extract version info from the driver, try to connect to the sample
// pubs2 database outside the Sybase corporate firewall.
import java.io.*;
import java.sql.*;
import com.sybase.utils.Debug;
import java.util.*;

public class Validate
{
public static void main(String args[])
{
String url = "jdbc:sybase:Tds:192.1.2.2:3270";
String proxy = "localhost:8000";
boolean tryingProxy = false;
try
{
Class.forName("com.sybase.jdbc.SybDriver");
Driver driver = DriverManager.getDriver(url);
int major = driver.getMajorVersion();
int minor = driver.getMinorVersion();
System.out.println("Using JDBC driver version " +
major + "." + minor);
Properties props = new Properties();
props.put("user", "trim");
props.put("password", "Hoosier");
DriverPropertyInfo dpi[] = driver.getPropertyInfo(url, props);
// get the version string
for (int i = 0; i < dpi.length; i++)
{
if (dpi[i].name.equals("VERSIONSTRING"))
{
System.out.println(dpi[i].value);
break;
}
}
System.out.println("Your CLASSPATH, Java environment, and " +
"jdbcConnect drivers are properly installed\n\ttrying to " +
"connect to the Sybase sample dataserver --\n\t...this will fail " +
"if your machine is not connected to the internet.");
// Timeouts cause Win95 to hang - some problem with the
// jConnect driver's use of threads to implement timouts...
// DriverManager.setLoginTimeout(10);

// attempt to connect to the sample database
Connection con = DriverManager.getConnection(url, props);
System.out.println("Connected successfully");
con.close();
}
catch (SQLException sqe)
{
String sqlstate = sqe.getSQLState();
String message = sqe.toString();
System.out.println("Unexpected exception: " + sqlstate);
if (sqlstate.equals("JZ0I4"))
{
if (message.indexOf("502") > 0)
{
System.out.println("\nThis error usually indicates that " +
"your HTTP gateway was unable to reach the database " +
"that you specified.\n\n One source of this problem may " +
"be that you are running the httpd/gateway under a " +
"JDK1.0.2 level VM. 1.0.2 has a bug where if you try " +
"to connect to an IP Address which your operation system " +
"does not have a 'name' for (gethostbyname fails?) " +
"then it cannot open a socket to it. This problem is " +
"fixed in JDK1.1 - if you kill your httpd gateway and " +
"restart it under JDK1.1 this problem may be resolved.");
}
else if (message.indexOf("Connection failed to") > 0)
{
if (tryingProxy)
{
System.out.println("\nThis error usually indicates that " +
"your HTTP gateway is NOT running. " +
"Check to see that " + proxy + " is responding.");
}
else
{
System.out.println("\nThis error often indicates that " +
"the database you are trying to connect to is not up. " +
"Try to verify (use a non-jdbc tool) that " + url +
" is running.");
}
}
}
sqe.printStackTrace();
System.exit(1);
}
catch (Throwable e)
{
System.out.println("Unexpected exception : " + e.toString());
if (e instanceof ClassNotFoundException)
{
System.out.println("\nThis error usually indicates that " +
"your Java CLASSPATH environment has not been " +
"set properly.");
}
if (e instanceof NoClassDefFoundError)
{
System.out.println("\nThis error may indicate there " +
"is a version incompatibility among the classes " +
"listed in your CLASSPATH.");
}
e.printStackTrace();
System.exit(1);
}
System.exit(0);
}
}

Using JDBC driver version 2.1
jConnect (TM) for JDBC(TM)/2.1/Trial Version expires Sep 7, 1997/JDK11/Wed Jul 9 0:18:55 1997
(Unlicenced)
Your CLASSPATH, Java environment, and jdbcConnect drivers are properly installed
trying to connect to the Sybase sample dataserver --
...this will fail if your machine is not connected to the internet.
Unexpected exception: ZZZZZ
java.sql.SQLException: : Invalid SybDriverKey for this jConnect driver
at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
at com.sybase.jdbc.SybDriver.setKey(SybDriver.java)
at com.sybase.jdbc.SybDriver.connect(SybDriver.java)
at java.sql.DriverManager.getConnection(DriverManager.java:91)
at Validate.main(Validate.java:45)


Lance Andersen Posted on 1997-07-17 12:48:23.0Z
Message-ID: <33CE1497.7C62@sybase.com>
Date: Thu, 17 Jul 1997 08:48:23 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: dgene@tudor.com
Subject: Re: getConnection
References: <33CD51C5.26ED@tudor.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 172
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:523
Article PK: 252273

Hi Gene,

Please download today's version of the driver. It should address
the issue for you.


-lance

Gene Dubetskiy wrote:
>
> Hi,
> I'm using Sun Solaris, JDK1.1.3. These are the java file and it's
> output. I've tried to telnet to the server port I'm using in the
> program and it works, isql works with the user and the password.
> Why am I geting this message?
>
> Gene
>
> ---------------------------------------------------------------
> // Extract version info from the driver, try to connect to the sample
> // pubs2 database outside the Sybase corporate firewall.
> import java.io.*;
> import java.sql.*;
> import com.sybase.utils.Debug;
> import java.util.*;
>
> public class Validate
> {
> public static void main(String args[])
> {
> String url = "jdbc:sybase:Tds:192.1.2.2:3270";
> String proxy = "localhost:8000";
> boolean tryingProxy = false;
> try
> {
> Class.forName("com.sybase.jdbc.SybDriver");
> Driver driver = DriverManager.getDriver(url);
> int major = driver.getMajorVersion();
> int minor = driver.getMinorVersion();
> System.out.println("Using JDBC driver version " +
> major + "." + minor);
> Properties props = new Properties();
> props.put("user", "trim");
> props.put("password", "Hoosier");
> DriverPropertyInfo dpi[] = driver.getPropertyInfo(url, props);
> // get the version string
> for (int i = 0; i < dpi.length; i++)
> {
> if (dpi[i].name.equals("VERSIONSTRING"))
> {
> System.out.println(dpi[i].value);
> break;
> }
> }
> System.out.println("Your CLASSPATH, Java environment, and " +
> "jdbcConnect drivers are properly installed\n\ttrying to " +
> "connect to the Sybase sample dataserver --\n\t...this will fail " +
> "if your machine is not connected to the internet.");
> // Timeouts cause Win95 to hang - some problem with the
> // jConnect driver's use of threads to implement timouts...
> // DriverManager.setLoginTimeout(10);
>
> // attempt to connect to the sample database
> Connection con = DriverManager.getConnection(url, props);
> System.out.println("Connected successfully");
> con.close();
> }
> catch (SQLException sqe)
> {
> String sqlstate = sqe.getSQLState();
> String message = sqe.toString();
> System.out.println("Unexpected exception: " + sqlstate);
> if (sqlstate.equals("JZ0I4"))
> {
> if (message.indexOf("502") > 0)
> {
> System.out.println("\nThis error usually indicates that " +
> "your HTTP gateway was unable to reach the database " +
> "that you specified.\n\n One source of this problem may " +
> "be that you are running the httpd/gateway under a " +
> "JDK1.0.2 level VM. 1.0.2 has a bug where if you try " +
> "to connect to an IP Address which your operation system " +
> "does not have a 'name' for (gethostbyname fails?) " +
> "then it cannot open a socket to it. This problem is " +
> "fixed in JDK1.1 - if you kill your httpd gateway and " +
> "restart it under JDK1.1 this problem may be resolved.");
> }
> else if (message.indexOf("Connection failed to") > 0)
> {
> if (tryingProxy)
> {
> System.out.println("\nThis error usually indicates that " +
> "your HTTP gateway is NOT running. " +
> "Check to see that " + proxy + " is responding.");
> }
> else
> {
> System.out.println("\nThis error often indicates that " +
> "the database you are trying to connect to is not up. " +
> "Try to verify (use a non-jdbc tool) that " + url +
> " is running.");
> }
> }
> }
> sqe.printStackTrace();
> System.exit(1);
> }
> catch (Throwable e)
> {
> System.out.println("Unexpected exception : " + e.toString());
> if (e instanceof ClassNotFoundException)
> {
> System.out.println("\nThis error usually indicates that " +
> "your Java CLASSPATH environment has not been " +
> "set properly.");
> }
> if (e instanceof NoClassDefFoundError)
> {
> System.out.println("\nThis error may indicate there " +
> "is a version incompatibility among the classes " +
> "listed in your CLASSPATH.");
> }
> e.printStackTrace();
> System.exit(1);
> }
> System.exit(0);
> }
> }
>
> ---------------------------------------------------------------
> Using JDBC driver version 2.1
> jConnect (TM) for JDBC(TM)/2.1/Trial Version expires Sep 7, 1997/JDK11/Wed Jul 9 0:18:55 1997
> (Unlicenced)
> Your CLASSPATH, Java environment, and jdbcConnect drivers are properly installed
> trying to connect to the Sybase sample dataserver --
> ...this will fail if your machine is not connected to the internet.
> Unexpected exception: ZZZZZ
> java.sql.SQLException: : Invalid SybDriverKey for this jConnect driver
> at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
> at com.sybase.jdbc.SybDriver.setKey(SybDriver.java)
> at com.sybase.jdbc.SybDriver.connect(SybDriver.java)
> at java.sql.DriverManager.getConnection(DriverManager.java:91)
> at Validate.main(Validate.java:45)

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Technical Support Phone:(617) 564-6336
77 South Bedford Street Fax: (617) 564-6148
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================


Lance Andersen Posted on 1997-07-17 12:45:01.0Z
Message-ID: <33CE13CD.726F@sybase.com>
Date: Thu, 17 Jul 1997 08:45:01 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: dgene@tudor.com
Subject: Re: getConnection
References: <33CD51C5.26ED@tudor.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 171
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:525
Article PK: 252276

Gene,

We should have a fix to address this issue shortly...


-lance

Gene Dubetskiy wrote:
>
> Hi,
> I'm using Sun Solaris, JDK1.1.3. These are the java file and it's
> output. I've tried to telnet to the server port I'm using in the
> program and it works, isql works with the user and the password.
> Why am I geting this message?
>
> Gene
>
> ---------------------------------------------------------------
> // Extract version info from the driver, try to connect to the sample
> // pubs2 database outside the Sybase corporate firewall.
> import java.io.*;
> import java.sql.*;
> import com.sybase.utils.Debug;
> import java.util.*;
>
> public class Validate
> {
> public static void main(String args[])
> {
> String url = "jdbc:sybase:Tds:192.1.2.2:3270";
> String proxy = "localhost:8000";
> boolean tryingProxy = false;
> try
> {
> Class.forName("com.sybase.jdbc.SybDriver");
> Driver driver = DriverManager.getDriver(url);
> int major = driver.getMajorVersion();
> int minor = driver.getMinorVersion();
> System.out.println("Using JDBC driver version " +
> major + "." + minor);
> Properties props = new Properties();
> props.put("user", "trim");
> props.put("password", "Hoosier");
> DriverPropertyInfo dpi[] = driver.getPropertyInfo(url, props);
> // get the version string
> for (int i = 0; i < dpi.length; i++)
> {
> if (dpi[i].name.equals("VERSIONSTRING"))
> {
> System.out.println(dpi[i].value);
> break;
> }
> }
> System.out.println("Your CLASSPATH, Java environment, and " +
> "jdbcConnect drivers are properly installed\n\ttrying to " +
> "connect to the Sybase sample dataserver --\n\t...this will fail " +
> "if your machine is not connected to the internet.");
> // Timeouts cause Win95 to hang - some problem with the
> // jConnect driver's use of threads to implement timouts...
> // DriverManager.setLoginTimeout(10);
>
> // attempt to connect to the sample database
> Connection con = DriverManager.getConnection(url, props);
> System.out.println("Connected successfully");
> con.close();
> }
> catch (SQLException sqe)
> {
> String sqlstate = sqe.getSQLState();
> String message = sqe.toString();
> System.out.println("Unexpected exception: " + sqlstate);
> if (sqlstate.equals("JZ0I4"))
> {
> if (message.indexOf("502") > 0)
> {
> System.out.println("\nThis error usually indicates that " +
> "your HTTP gateway was unable to reach the database " +
> "that you specified.\n\n One source of this problem may " +
> "be that you are running the httpd/gateway under a " +
> "JDK1.0.2 level VM. 1.0.2 has a bug where if you try " +
> "to connect to an IP Address which your operation system " +
> "does not have a 'name' for (gethostbyname fails?) " +
> "then it cannot open a socket to it. This problem is " +
> "fixed in JDK1.1 - if you kill your httpd gateway and " +
> "restart it under JDK1.1 this problem may be resolved.");
> }
> else if (message.indexOf("Connection failed to") > 0)
> {
> if (tryingProxy)
> {
> System.out.println("\nThis error usually indicates that " +
> "your HTTP gateway is NOT running. " +
> "Check to see that " + proxy + " is responding.");
> }
> else
> {
> System.out.println("\nThis error often indicates that " +
> "the database you are trying to connect to is not up. " +
> "Try to verify (use a non-jdbc tool) that " + url +
> " is running.");
> }
> }
> }
> sqe.printStackTrace();
> System.exit(1);
> }
> catch (Throwable e)
> {
> System.out.println("Unexpected exception : " + e.toString());
> if (e instanceof ClassNotFoundException)
> {
> System.out.println("\nThis error usually indicates that " +
> "your Java CLASSPATH environment has not been " +
> "set properly.");
> }
> if (e instanceof NoClassDefFoundError)
> {
> System.out.println("\nThis error may indicate there " +
> "is a version incompatibility among the classes " +
> "listed in your CLASSPATH.");
> }
> e.printStackTrace();
> System.exit(1);
> }
> System.exit(0);
> }
> }
>
> ---------------------------------------------------------------
> Using JDBC driver version 2.1
> jConnect (TM) for JDBC(TM)/2.1/Trial Version expires Sep 7, 1997/JDK11/Wed Jul 9 0:18:55 1997
> (Unlicenced)
> Your CLASSPATH, Java environment, and jdbcConnect drivers are properly installed
> trying to connect to the Sybase sample dataserver --
> ...this will fail if your machine is not connected to the internet.
> Unexpected exception: ZZZZZ
> java.sql.SQLException: : Invalid SybDriverKey for this jConnect driver
> at com.sybase.jdbc.ErrorMessage.raiseError(ErrorMessage.java)
> at com.sybase.jdbc.SybDriver.setKey(SybDriver.java)
> at com.sybase.jdbc.SybDriver.connect(SybDriver.java)
> at java.sql.DriverManager.getConnection(DriverManager.java:91)
> at Validate.main(Validate.java:45)

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Technical Support Phone:(617) 564-6336
77 South Bedford Street Fax: (617) 564-6148
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================