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.

/database in URL for SQL Anywhere

8 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-08-08 18:26:09.0Z
Jason Kelley Posted on 1997-08-07 19:14:12.0Z
Message-ID: <33EA1E84.2B9E@investlearning.com>
Date: Thu, 07 Aug 1997 12:14:12 -0700
From: Jason Kelley <jkelley@investlearning.com>
Organization: Invest Learning
X-Mailer: Mozilla 2.0 (Win95; I; 16bit)
MIME-Version: 1.0
Subject: /database in URL for SQL Anywhere
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 15
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:396
Article PK: 252148

Chapter 2 (Programming Information) in the jConnect Programmer's
Reference says...

In your Java application, create a URL to connect to the jConnect driver.
There are 3 acceptable syntaxes:


jdbc:sybase:Tds:host:port
jdbc:sybase:Tds:host:port/
jdbc:sybase:Tds:host:port/database

<snip>

database - use named database (preceded by a slash '/')


Is the /database part of the URL supported when using jConnect with SQL
Anywhere? (My tests seem to indicate that it's ignored.)

TIA
Jason Kelley
Invest Learning


David Clegg Posted on 1997-08-07 17:36:52.0Z
Message-ID: <33EA07B4.7AC3FDE4@sybase.com>
Date: Thu, 07 Aug 1997 10:36:52 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 3.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: Jason Kelley <jkelley@investlearning.com>
Subject: Re: /database in URL for SQL Anywhere
References: <33EA1E84.2B9E@investlearning.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 19
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:395
Article PK: 252147

Right, it is ignored. SQLAnywhere does not support the concept
of multiple databases in a single database server.

dave

>
> Chapter 2 (Programming Information) in the jConnect Programmer's
> Reference says...
>
> In your Java application, create a URL to connect to the jConnect driver.
> There are 3 acceptable syntaxes:
>
> jdbc:sybase:Tds:host:port
> jdbc:sybase:Tds:host:port/
> jdbc:sybase:Tds:host:port/database
>
> <snip>
>
> database - use named database (preceded by a slash '/')
>
> Is the /database part of the URL supported when using jConnect with SQL
> Anywhere? (My tests seem to indicate that it's ignored.)
>
> TIA
> Jason Kelley
> Invest Learning


Jason Kelley Posted on 1997-08-07 21:03:00.0Z
Message-ID: <33EA3804.9D2@investlearning.com>
Date: Thu, 07 Aug 1997 14:03:00 -0700
From: Jason Kelley <jkelley@investlearning.com>
Organization: Invest Learning
X-Mailer: Mozilla 2.0 (Win95; I; 16bit)
MIME-Version: 1.0
Subject: Re: /database in URL for SQL Anywhere
References: <33EA1E84.2B9E@investlearning.com> <33EA07B4.7AC3FDE4@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 19
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:393
Article PK: 252144


> Right, it is ignored. SQLAnywhere does not support the concept
> of multiple databases in a single database server.
>
> dave

I'm still a little confused. SQL Anywhere DOES support multiple databases on a single database
server. For example, I use the following command (Win95):

dbsrv50 -n SQLAny c:\sybase\sqlany50\sademo c:\sybase\databases\jdbctest

This starts a SQL Anywhere server named SQLAny and loads the two databases sademo and jdbctest.

So, why does jConnect ignore the /database part of the URL when I can have multiple databases loaded
on a single server? (My project actually requires multiple databases on a single server.) Does OSG
(Open Server Gateway) play a role in this?

Jason


David Lance Wolf Posted on 1997-08-07 22:27:14.0Z
Message-ID: <33EA4BC1.CDA967E0@sybase.com>
Date: Thu, 07 Aug 1997 15:27:14 -0700
From: David Lance Wolf <dwolf@sybase.com>
Organization: Sybase Professional Services
X-Mailer: Mozilla 4.01 [en] (Win95; U)
MIME-Version: 1.0
Subject: Re: /database in URL for SQL Anywhere
X-Priority: 3 (Normal)
References: <33EA1E84.2B9E@investlearning.com> <33EA07B4.7AC3FDE4@sybase.com> <33EA3804.9D2@investlearning.com>
Content-Type: multipart/mixed; boundary="------------1B6F434ECEEFF1E0D47A3FF7"
Newsgroups: sybase.public.jdbcconnect
Lines: 60
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:392
Article PK: 252143

Jason-

I've been playing with the OpenServer gateway some. Check out the -e
and -d switches.

If I set the -e to dwolf (my server) and -dsademo then no matter what
the /database is set to, I get a connection to sademo. If I set -dusps,
same thing, I get usps connection. If I set the -dfoobar and have
either /sademo or /usps I get thrown a java.sql.ResultSet.SQLException
saying specified database not found.......

You could run several osgateways on several ports, one for each db??
Unless someone knows of another way. I'm also curious about the 'use
procedure not found' exception that gets thrown when i specify
sademo.db.....

Let me know how it goes.

Dave Wolf
Sybase Professional Services

Jason Kelley wrote:

> > Right, it is ignored. SQLAnywhere does not support the concept
> > of multiple databases in a single database server.
> >
> > dave
>
> I'm still a little confused. SQL Anywhere DOES support multiple
> databases on a single database
> server. For example, I use the following command (Win95):
>
> dbsrv50 -n SQLAny c:\sybase\sqlany50\sademo
> c:\sybase\databases\jdbctest
>
> This starts a SQL Anywhere server named SQLAny and loads the two
> databases sademo and jdbctest.
>
> So, why does jConnect ignore the /database part of the URL when I can
> have multiple databases loaded
> on a single server? (My project actually requires multiple databases
> on a single server.) Does OSG
> (Open Server Gateway) play a role in this?
>
> Jason


Download VCard vcard.vcf


Eric Giguere Posted on 1997-08-07 19:25:10.0Z
From: "Eric Giguere" <giguere@watcom.com>
Subject: Re: /database in URL for SQL Anywhere
References: <33EA1E84.2B9E@investlearning.com> <33EA07B4.7AC3FDE4@sybase.com> <33EA3804.9D2@investlearning.com> <33EA4BC1.CDA967E0@sybase.com>
Organization: Sybase, Inc. (Waterloo)
Message-ID: <01bca378$99049a70$9e8c1fac@giguere-pc>
X-Newsreader: Microsoft Internet News 4.70.1161
Newsgroups: sybase.public.jdbcconnect
Date: Thu, 07 Aug 1997 15:25:10 -0400
Lines: 3
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:391
Article PK: 252142

The only way to get multiple databases to work is to run multiple copies of
Open Server Gateway.

Eric


Jason Kelley Posted on 1997-08-08 18:26:09.0Z
Message-ID: <33EB64C1.5E3E@investlearning.com>
Date: Fri, 08 Aug 1997 11:26:09 -0700
From: Jason Kelley <jkelley@investlearning.com>
Organization: Invest Learning
X-Mailer: Mozilla 2.0 (Win95; I; 16bit)
MIME-Version: 1.0
Subject: Open Server Gateway connects to database not server
References: <33EA1E84.2B9E@investlearning.com> <33EA07B4.7AC3FDE4@sybase.com> <33EA3804.9D2@investlearning.com> <33EA4BC1.CDA967E0@sybase.com> <01bca378$99049a70$9e8c1fac@giguere-pc>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 12
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:389
Article PK: 252141


Eric Giguere wrote:
>
> The only way to get multiple databases to work is to run multiple copies of
> Open Server Gateway.
>
> Eric

(Eric, maybe this should be posted in sybase.public.sqlanywhere.general
?)

Why does OSG connect to a specific database which must already be running
on a server? Why can't OSG connect to a server, instead? Or at least,
why can't OSG specify a database file to be loaded on the server?

Jason


Jason Kelley Posted on 1997-08-08 18:22:21.0Z
Message-ID: <33EB63DD.6E2C@investlearning.com>
Date: Fri, 08 Aug 1997 11:22:21 -0700
From: Jason Kelley <jkelley@investlearning.com>
Organization: Invest Learning
X-Mailer: Mozilla 2.0 (Win95; I; 16bit)
MIME-Version: 1.0
Subject: Re: /database in URL for SQL Anywhere
References: <33EA1E84.2B9E@investlearning.com> <33EA07B4.7AC3FDE4@sybase.com> <33EA3804.9D2@investlearning.com> <33EA4BC1.CDA967E0@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 12
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:390
Article PK: 252146

David,

> You could run several osgateways on several ports, one for each db??

I was able to run two OSGs - one on port 5000, the other on port 5001 and
access both of my databases. My connection URLs look like this:

jdbc:sybase:Tds:localhost:5000
jdbc:sybase:Tds:localhost:5001

Now, I just hope all the experimenting I've done on my Win95 workstation
will transfer when I put the database server on a Netware server and then
on an NT server.

Jason


David Lance Wolf Posted on 1997-08-07 20:40:15.0Z
Message-ID: <33EA32AE.B3A256C7@sybase.com>
Date: Thu, 07 Aug 1997 13:40:15 -0700
From: David Lance Wolf <dwolf@sybase.com>
Organization: Sybase Professional Services
X-Mailer: Mozilla 4.01 [en] (Win95; U)
MIME-Version: 1.0
Subject: Re: /database in URL for SQL Anywhere
X-Priority: 3 (Normal)
References: <33EA1E84.2B9E@investlearning.com> <33EA07B4.7AC3FDE4@sybase.com>
Content-Type: multipart/mixed; boundary="------------F45442197D931774C2654D6A"
Newsgroups: sybase.public.jdbcconnect
Lines: 84
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:394
Article PK: 252145

David et al,

Something interesting however. Actually SQLA does support multiple DB's
if you run the server just not the 'use' statement. You need to
reconnect to switch DB's, but I should be able to choose which DB I get
connected to. So I tried this, statrted the SQLA server with two
databases. Database usps first, the Database sademo. I ran the
following code. If I make the URL,

jdbc:sybase:Tds:127.0.0.1:7000/sademo
and select db_name()

The results are as I might expect I guess, usps (The first one loaded,
hence the default db), since I assumed the 'use' would get ignored, just
as it is ignored vi isal. BUT...... I tried this URL

jdbc:sybase:Tds:127.0.0.1:7000/sademo.db
I get thrown the SQLExcpetion 'use procedure no found'

So it looks like the driver tried to execute a use?? Is there something
more to this?? Is there no way to choose between X db's that SQLA
server has loaded??

Dave Wolf
Sybase Professional Services

Code as follows: JDK 1.1.3 on WIN95 using SUN's VM

import java.sql.*;
import java.io.*;
import java.util.*;

public class TestDB
{

public static void main(String args[])
{
try
{
Class.forName("com.sybase.jdbc.SybDriver");
Properties p = new Properties();
p.put("user","dba");
p.put("password","sql");
Connection conn =
DriverManager.getConnection("jdbc:sybase:Tds:127.0.0.1:7000/sademo.db",
p);
ResultSet rs = conn.createStatement().executeQuery("Select
db_name()");
rs.next();
String name = rs.getString(1);
System.out.println(name);
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
}

David Clegg wrote:

> Right, it is ignored. SQLAnywhere does not support the concept
> of multiple databases in a single database server.
>
> dave
> >
> > Chapter 2 (Programming Information) in the jConnect Programmer's
> > Reference says...
> >
> > In your Java application, create a URL to connect to the jConnect
> driver.
> > There are 3 acceptable syntaxes:
> >
> > jdbc:sybase:Tds:host:port
> > jdbc:sybase:Tds:host:port/
> > jdbc:sybase:Tds:host:port/database
> >
> > <snip>
> >
> > database - use named database (preceded by a slash '/')
> >
> > Is the /database part of the URL supported when using jConnect with
> SQL
> > Anywhere? (My tests seem to indicate that it's ignored.)
> >
> > TIA
> > Jason Kelley
> > Invest Learning


Download VCard vcard.vcf