of cource you there is!!!
2.3.3 Formulating a Database URL
After you've loaded the driver, you can establish a connection using
the
DriverManager.getConnection( ) method. This method is overloaded and
therefore has
various forms. However, each form requires a database URL. A database
URL is an address that
points to your database. Formulating a database URL is where most of
the problems associated
with establishing a connection occur. For Oracle, the database URL has
the following general
form:
jdbc:oracle:driver:@database
database ::= {host:port:sid | net_service_name | connect_descriptor}
which breaks down as:
driver
Specifies the type of JDBC driver to use for the connection. The
following choices are
available:
oci7
For the Oracle 7.3.4 OCI driver
oci8
For an Oracle 8.x.x OCI driver
oci
For an Oracle 9.x.x OCI driver
thin
For the Oracle Thin driver
kprb
For the Oracle internal driver
database
Specifies the database to which you want to connect. You can specify a
host, port, and
SID; a net service name; or a connect descriptor.
host:port:sid
Used only with the Thin driver and identifies the target database using
the following
information:
host
The TCP/IP address or DNS alias (hostname) for your database server
port
The TCP/IP port number of the Oracle listener
sid
The System Identifier of your database
net_service_name
Used only with the OCI driver. A net service name, or tnsnames.ora file
entry as it is
commonly known, is a short name that resolves to a connect descriptor,
which is a
specially formatted Net8 database address. Net service names are often
resolved via a
local file named tnsnames.ora but may also be resolved using
centralized methods such
as Oracle Names. The OCI driver depends on the Oracle Client software
to be able to
resolve a net service name. That's why net service names are used only
with the OCI
driver.
connect_descriptor
Can be used by either driver and is a Net8 address specification such
as that normally
found in a tnsnames.ora file.
Now that you know the rules of how to formulate a database URL, let's
look at several examples
as we explore the overloaded forms of the getConnection( ) method.
it's from
Java Programming with Oracle JDBC
Donald Bales
Publisher: O'Reilly
First Edition January 2002
ISBN: 0-596-00088-x, 496 pages
By GiantDino
I have not time to write a full answer ... sorry ... just send me a
message to my email if you have any question. I'll try to help you!