dbTalk Databases Forums  

How-to know that ASA server is on network

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss How-to know that ASA server is on network in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
handheldmaster
 
Posts: n/a

Default How-to know that ASA server is on network - 04-11-2006 , 03:51 PM






Using 9.0.2.3274 on win32

Is their a way through code or technique that the client will auto-find the
server. Do not want to add a "configuration" file to client pc's. Almost
what I would be looking for is the BROWSE feature on the iAnywhere
interactive SQL app. If only one found then attempt connection.

This will reduce a lot of heartburn of setting up client pc's and making
sure client's are connecting to the right server even if the ip address of
server changes dhcp.



Reply With Quote
  #2  
Old   
Mark Culp
 
Posts: n/a

Default Re: How-to know that ASA server is on network - 04-11-2006 , 06:04 PM






What database API are you using, ODBC, ESQL, ADO.Net, ...?

Provided you are using one of the native ASA APIs (ODBC, ESQL, etc),
and the server is running within the same subnet as the client computer,
then the client application should be able to connect to the server
automatically
(without any preconfiguration files) as long as you specify
LINKS=TCPIP;ENG=<NAME_OF_YOUR_SERVER>
in your connection string. i.e. the client will use a UDP broadcast
to find the location of the server and then connect to it.

To implement the BROWSE functionality, look at the db_locate_servers() function
in the documentation - the SC/dbisql tools and dblocate simply call this routine
and handle the callbacks appropriatesly.
--
Mark Culp
SQLAnywhere Research and Development
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------
handheldmaster wrote:
Quote:
Using 9.0.2.3274 on win32

Is their a way through code or technique that the client will auto-find the
server. Do not want to add a "configuration" file to client pc's. Almost
what I would be looking for is the BROWSE feature on the iAnywhere
interactive SQL app. If only one found then attempt connection.

This will reduce a lot of heartburn of setting up client pc's and making
sure client's are connecting to the right server even if the ip address of
server changes dhcp.

Reply With Quote
  #3  
Old   
handheldmaster
 
Posts: n/a

Default Re: How-to know that ASA server is on network - 04-12-2006 , 01:38 PM



Quote:
What database API are you using, ODBC, ESQL, ADO.Net, ...?
Am using Java - JConnect 4 from sybase; The client pcs will be a mix of
windows and linux based operating systems.

Quote:
To implement the BROWSE functionality, look at the db_locate_servers()
function
in the documentation - the SC/dbisql tools and dblocate simply call this
routine
and handle the callbacks appropriatesly.
--
As such no sybase isql or sybase will be installed on any of the client pcs
hence cannot use the dblocate.exe to enumerate servers on the network.

Quote:
Provided you are using one of the native ASA APIs (ODBC, ESQL, etc),
and the server is running within the same subnet as the client computer,
then the client application should be able to connect to the server
automatically
(without any preconfiguration files) as long as you specify
LINKS=TCPIP;ENG=<NAME_OF_YOUR_SERVER
in your connection string. i.e. the client will use a UDP broadcast
to find the location of the server and then connect to it.

Hmm.. What if I don't know even the ENGINE NAME ?





Reply With Quote
  #4  
Old   
Mark Culp
 
Posts: n/a

Default Re: How-to know that ASA server is on network - 04-12-2006 , 02:27 PM



Reponses inline

handheldmaster wrote:
Quote:
What database API are you using, ODBC, ESQL, ADO.Net, ...?
Am using Java - JConnect 4 from sybase; The client pcs will be a mix of
windows and linux based operating systems.
JConnect does not have a way of discovering where the engine is - you
must already know the host and port number. You could switch to using
the iAnywhere JDBC driver - it is a "native" ASA driver, and hence it can
use the broadcast mechanism to find where the server is.

Quote:
To implement the BROWSE functionality, look at the db_locate_servers()
function
in the documentation - the SC/dbisql tools and dblocate simply call this
routine
and handle the callbacks appropriatesly.
--
As such no sybase isql or sybase will be installed on any of the client pcs
hence cannot use the dblocate.exe to enumerate servers on the network.
If you don't have any client s/w installed, you can't do much.

Quote:
Provided you are using one of the native ASA APIs (ODBC, ESQL, etc),
and the server is running within the same subnet as the client computer,
then the client application should be able to connect to the server
automatically
(without any preconfiguration files) as long as you specify
LINKS=TCPIP;ENG=<NAME_OF_YOUR_SERVER
in your connection string. i.e. the client will use a UDP broadcast
to find the location of the server and then connect to it.

Hmm.. What if I don't know even the ENGINE NAME ?
If you don't know the engine name, how do you know what you are looking for?
And if you do connect to a server, how do you know that you have connected
to the right one?
--
Mark Culp
SQLAnywhere Research and Development
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------


Reply With Quote
  #5  
Old   
handheldmaster
 
Posts: n/a

Default Re: How-to know that ASA server is on network - 04-13-2006 , 08:55 AM





Quote:
JConnect does not have a way of discovering where the engine is - you
must already know the host and port number. You could switch to using
the iAnywhere JDBC driver - it is a "native" ASA driver, and hence it can
use the broadcast mechanism to find where the server is.

Would any one on the newsgroup have a download link for this ?

Quote:
Provided you are using one of the native ASA APIs (ODBC, ESQL, etc),
and the server is running within the same subnet as the client
computer,
then the client application should be able to connect to the server
automatically
(without any preconfiguration files) as long as you specify
LINKS=TCPIP;ENG=<NAME_OF_YOUR_SERVER
in your connection string. i.e. the client will use a UDP broadcast
to find the location of the server and then connect to it.

Hmm.. What if I don't know even the ENGINE NAME ?

If you don't know the engine name, how do you know what you are looking
for?
And if you do connect to a server, how do you know that you have connected
to the right one?
--
Well we would know by physical location one server per location. Idea was to
basically let the db admins have whatever they want to call the server and
whatever port, ip they want to run it under. Then deploy thousands of
clients going to different companies and "magically" they find the server ..
we show them a userid/password authentication box ... so this is like a
one-time setup. Basically saves the heartburn of creating & managing those
gazillion configuration files.

Thx for your responses.




Reply With Quote
  #6  
Old   
Mark Culp
 
Posts: n/a

Default Re: How-to know that ASA server is on network - 04-13-2006 , 10:29 AM



The iAnywhere JDBC driver is include in the SQLAnywhere installation package.
Look in the 9.0.2 documentation
ASA Programming Guide
JDBC Programming
JDBC overview
Choosing a JDBC driver
for more information - you can see the docs online at
http://www.ianywhere.com/developer/p...9/00000140.htm

If you are going to allow your site admins choose the name of the server,
then you are also going to need a method of specifying the name of the
server at each client. I.e. the client application must specify the name
of the server in the connection string in order to ensure that it connects
to the correct database server. It is also recommended that the connection
string specify the name of the database so that it is ensured that the
client connects to the correct database (since a server may run more than
one database).
--
Mark Culp
SQLAnywhere Research and Development
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------
handheldmaster wrote:
Quote:
JConnect does not have a way of discovering where the engine is - you
must already know the host and port number. You could switch to using
the iAnywhere JDBC driver - it is a "native" ASA driver, and hence it can
use the broadcast mechanism to find where the server is.


Would any one on the newsgroup have a download link for this ?


Provided you are using one of the native ASA APIs (ODBC, ESQL, etc),
and the server is running within the same subnet as the client
computer,
then the client application should be able to connect to the server
automatically
(without any preconfiguration files) as long as you specify
LINKS=TCPIP;ENG=<NAME_OF_YOUR_SERVER
in your connection string. i.e. the client will use a UDP broadcast
to find the location of the server and then connect to it.

Hmm.. What if I don't know even the ENGINE NAME ?

If you don't know the engine name, how do you know what you are looking
for?
And if you do connect to a server, how do you know that you have connected
to the right one?
--
Well we would know by physical location one server per location. Idea was to
basically let the db admins have whatever they want to call the server and
whatever port, ip they want to run it under. Then deploy thousands of
clients going to different companies and "magically" they find the server ..
we show them a userid/password authentication box ... so this is like a
one-time setup. Basically saves the heartburn of creating & managing those
gazillion configuration files.

Thx for your responses.

Reply With Quote
  #7  
Old   
Greg Fenton
 
Posts: n/a

Default Re: How-to know that ASA server is on network - 04-13-2006 , 01:09 PM



Mark Culp wrote:
Quote:
The iAnywhere JDBC driver is include in the SQLAnywhere installation package.
Look in the 9.0.2 documentation
ASA Programming Guide
JDBC Programming
JDBC overview
Choosing a JDBC driver
Also see:

http://www.ianywhere.com/developer/t...bc_driver.html

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.