Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: database connection with JDBC

Re: database connection with JDBC

From: Jake <jjstrauss_at_yahoo.com>
Date: Thu, 26 Oct 2000 09:25:29 -0500
Message-ID: <NAMJ5.17028$vy5.551999@e420r-sjo3.usenetserver.com>

This may be a little off topic but does JDBC use sqlnet? From the connection string it doesn't look like it. So I'm wondering how does the listener pick up the requests?

--
Jake
"C. Ferguson" <c_ferguson_at_rationalconcepts.com> wrote in message
news:39F72375.530372E6_at_rationalconcepts.com...

> Welcome to java and Oracle.
> To get started off on the right foot with either, vist the
> http://www.javasoft.com site and learn, learn, learn.
> Then go and visit http://technet.oracle.com/sample_code/index.htm. You
> will need a technet account to browse the info, but those are free so sign
> up.
>
> Now, the error in your code is due to the syntax you are using:
> DriverManager.getConnection(
> "jdbc:oracle:thin://42.221.200.200:1521/dw1",
> "username",
> "userID");
>
> (looks like mysql syntax...)
> anyway the corrected syntax is
> String usename = "scott";
> String userID = "tiger";
> DriverManager.getConnection(
> "jdbc:oracle:thin:@42.221.200.200:1521:dw1",
> username,
> userID);
>
> If you wanted to alternately register the driver via the
> Class.forName(String s) method,
> String s = "oracle.jdbc.driver.OracleDriver";
> Class.forName(s).newInstance();
>
> Good luck and please don't make the mistake of many by not reading the
> documentation.
>
> hth,
> cindy
>
>
> dongbo_at_my-deja.com wrote:
>
> > Hi,
> >
> > I'm new to JDBC and Oracle. I'm trying to access an Oracle8.1.6 server
> > (NT) from another NT box by using jdbc-thin.
> >
> > First, registered the driver, which looked OK:
> > DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
> >
> > Then, tried to connect to the database server, using
> > Connection c = DriverManager.getConnection(
> > "jdbc:oracle:thin://42.221.200.200:1521/dw1",
> > "username",
> > "userID");
> > here, "dw1" is my database name. This failed.
> >
> > Can anybody tell me, what's wrong with my code?
> >
> > By the way, if I want to load db driver (thin) from method
> > Class.forName(String s), what s will look like.
> >
> > I greatly appreciate all the answers/suggestions. Thanks.
> >
> > Dongbo Liao
> > dliao_at_crl.nmsu.edu
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Received on Thu Oct 26 2000 - 09:25:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US