Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: A little help connecting to oracle from java. Anyone? Please!!? :-)
"Simon Harvey" <noThanks_at_pdf.com> wrote in message
news:3d554318_1_at_news.teranews.com...
> DSN Version:
> String connectionString = "
jdbc:oracle:thin:localhost:1521:daytonDSN";
>
> What I think is the Service Name version:
> String connectionString = "
> jdbc:oracle:thin:localhost:1521:dayton.homenet";
> also tried:
> String connectionString = " jdbc:oracle:thin:localhost:1521:DAYTON";
You have to get it juuuuust right:
String connectionString = " jdbc:oracle:thin:@localhost:1521:DAYTON";
Works fine. the @ with nothing in front indicates an anonymous user, but you generally put the uid and passwd into the createConnection() method call. The full syntax is
String connectionString = "
jdbc:oracle:thin:SCOTT/TIGER_at_localhost:1521:DAYTON";
but no-one uses it AFAIK.