In the JDK documentation, the 'java.sql.DriverManager.getConnection(string, url)' method is described as follows:
getConnection
public static Connection getConnection(String url,
Properties info) throws SQLException
Attempt to establish a connection to the
given database URL. The DriverManager attempts to select an appropriate
driver from the set of registered JDBC
drivers.
Parameters:
url - a database
url of the form jdbc:subprotocol:subname
info - a
list of arbitrary string tag/value pairs as connection arguments; normally
at least a "user" and "password" property should be included
Returns:
a Connection
to the URL
Throws:
SQLException
- if a database-access error occurs.
where url - a database url of the form jdbc:subprotocol:subname;
can I specify an internet URL, say (using the JDBC/ODBC Bridge) :-
jdbc:odbc:http://+host+/+odbcDataSourceName+
eg. jdbc:odbc:http://www.blofeld.com/contactDB
?
Or, if not, how can make a connection to a datasource that isn't on
my local machine?
regards
don
No! A JDBC URL has nothing to see with http.
> Or, if not, how can make a connection to a datasource that isn't on my
> local machine?
>
You need a client/server JDBC Driver: such a driver will allow to
specify a host name or address in order to connect, of course.
The JDBC/ODBC bridge is not client/server: it allows to connect a DB on
the local host.
If you need a cheap solution, we've got a freeware JDBC Driver (RmiJdbc,
at http://dyade.inrialpes.fr/mediation/download) that can make the
JDBC/ODBC bridge client-server.
If you need high performance, buy a commercial driver dedicated to the
database you are using.
Regards,
Pierre-Yves Gibello :)
JDBC-ODBC bridge is not capable of accessing a remote data source over the
internet. <- that is a period! <- that is an exclamation mark
You need a Type-3 driver like IDS JDBC Driver (with a middle server) to do that.
A type-4 driver usually offers remote db access as well.
Thank you
Michael Chen
IDS Software -- Home of IDS Server
The best Type-3 JDBC driver solution.
http://www.idssoftware.com/
----------
Ql8a wrote in message <35ED50A1...@easynet.co.uk>...
I am trying to create a connection to a remote database on the internet, and am
wondering if I can specify the datasource as a URL.
can I specify an internet URL, say (using the JDBC/ODBC Bridge) :-
jdbc:odbc:http://+host+/+odbcDataSourceName+
eg. jdbc:odbc:http://www.blofeld.com/contactDB
?
Or, if not, how can make a connection to a datasource that isn't on my local machine?
regards
don