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.

Connecting to the database via a LAN using jdbcconnect

3 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-05-12 20:54:25.0Z
Idith Dahan Posted on 1997-05-12 16:42:47.0Z
Message-ID: <33774887.899@Softway.fr>
Date: Mon, 12 May 1997 09:42:47 -0700
From: Idith Dahan <idith@Softway.fr>
Reply-To: idith@Softway.fr
Organization: Softway
X-Mailer: Mozilla 3.01 [fr] (WinNT; I)
MIME-Version: 1.0
Subject: Connecting to the database via a LAN using jdbcconnect
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 78
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:845
Article PK: 252599

I downloaded the package Sybase jConnect for JDBC for Windows NT and
installed it successfully.

I use a LAN to connect a client to a server containing the database. I
don't want to connect to the database via the Internet (via a HTTP/JDBC
gateway), but only via the LAN, using the TCP/IP protocols.

My OS is Windows NT 4.0.
I use Netscape 3.01.
I have Sybase SQL Server ver. 11.0.2, JDBC ver. 2.1 and the JDK 1.1.1.

The source of the application is :

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:lab3:5000"; //The url of my
machine
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", "sa");
props.put("password", "");
DriverPropertyInfo dpi[] =
driver.getPropertyInfo(url,props);
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();
System.out.println("Now connecting through your HTTP/JDBC
Gateway");
tryingProxy = true;
props.put("proxy", proxy);
con = DriverManager.getConnection(url, props);
System.out.println("Connected successfully");
con.close();
}

When I try to connect to the database via the LAN, I get the following
error : " Your HTTP Gateway is not running".

Then, I would like to know if it's possible to modify the source so as
to connect the client only via the LAN(with out Http Gateway).

Thanks in advance. You can reply to me at : mailto:idith@softway.fr


Idith DAHAN from Softway France


Steven Weisbart <?? Posted on 1997-05-12 20:54:25.0Z
Date: Mon, 12 May 1997 13:54:25 -0700
From: Steven Weisbart <??@??.com>
X-Mailer: Mozilla 3.0 (X11; U; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: idith@Softway.fr
Subject: Re: Connecting to the database via a LAN using jdbcconnect
References: <33774887.899@Softway.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <FgGSN4wX8GA.130@forums.powersoft.com>
Newsgroups: sybase.public.jdbcconnect
Lines: 91
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:839
Article PK: 252591

The http gateway is only needed in the case where you are
running an applet that was loaded from a different machine
than the applet. Normally this means the web server and
SQL server are on different machines. In other
cases the http proxy server should not be needed at all
and the proxy property should not be set.

Steve W.

Idith Dahan wrote:
>
> I downloaded the package Sybase jConnect for JDBC for Windows NT and
> installed it successfully.
>
> I use a LAN to connect a client to a server containing the database. I
> don't want to connect to the database via the Internet (via a HTTP/JDBC
> gateway), but only via the LAN, using the TCP/IP protocols.
>
> My OS is Windows NT 4.0.
> I use Netscape 3.01.
> I have Sybase SQL Server ver. 11.0.2, JDBC ver. 2.1 and the JDK 1.1.1.
>
> The source of the application is :
>
> 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:lab3:5000"; //The url of my
> machine
> 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", "sa");
> props.put("password", "");
> DriverPropertyInfo dpi[] =
> driver.getPropertyInfo(url,props);
> 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();
> System.out.println("Now connecting through your HTTP/JDBC
> Gateway");
> tryingProxy = true;
> props.put("proxy", proxy);
> con = DriverManager.getConnection(url, props);
> System.out.println("Connected successfully");
> con.close();
> }
>
> When I try to connect to the database via the LAN, I get the following
> error : " Your HTTP Gateway is not running".
>
> Then, I would like to know if it's possible to modify the source so as
> to connect the client only via the LAN(with out Http Gateway).
>
> Thanks in advance. You can reply to me at : mailto:idith@softway.fr
>
> Idith DAHAN from Softway France


Lance Andersen Posted on 1997-05-12 19:38:29.0Z
Message-ID: <337771B5.173A@sybase.com>
Date: Mon, 12 May 1997 15:38:29 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: idith@Softway.fr
Subject: Re: Connecting to the database via a LAN using jdbcconnect
References: <33774887.899@Softway.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 97
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:840
Article PK: 252592

You do not need to use a proxy via a standalone java program.

Remove the line: props.put("proxy", proxy);

and you will not longer attempt to use a proxy.


-lance

Idith Dahan wrote:
>
> I downloaded the package Sybase jConnect for JDBC for Windows NT and
> installed it successfully.
>
> I use a LAN to connect a client to a server containing the database. I
> don't want to connect to the database via the Internet (via a HTTP/JDBC
> gateway), but only via the LAN, using the TCP/IP protocols.
>
> My OS is Windows NT 4.0.
> I use Netscape 3.01.
> I have Sybase SQL Server ver. 11.0.2, JDBC ver. 2.1 and the JDK 1.1.1.
>
> The source of the application is :
>
> 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:lab3:5000"; //The url of my
> machine
> 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", "sa");
> props.put("password", "");
> DriverPropertyInfo dpi[] =
> driver.getPropertyInfo(url,props);
> 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();
> System.out.println("Now connecting through your HTTP/JDBC
> Gateway");
> tryingProxy = true;
> props.put("proxy", proxy);
> con = DriverManager.getConnection(url, props);
> System.out.println("Connected successfully");
> con.close();
> }
>
> When I try to connect to the database via the LAN, I get the following
> error : " Your HTTP Gateway is not running".
>
> Then, I would like to know if it's possible to modify the source so as
> to connect the client only via the LAN(with out Http Gateway).
>
> Thanks in advance. You can reply to me at : mailto:idith@softway.fr
>
> Idith DAHAN from Softway France

--
===============================================================================
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!!!
===============================================================================