jQuery in Action, 2nd edition
The moose likes JDBC and the fly likes Connect to a local Oracle database Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JDBC
Reply Bookmark "Connect to a local Oracle database" Watch "Connect to a local Oracle database" New topic
Author

Connect to a local Oracle database

Mike Yu
Ranch Hand

Joined: Nov 17, 2001
Posts: 175
Hello,
Many posts in this forum discussed about connection to Oracle with url= jdbc:oracle:thin:@host:1521:sid.
If the Oracle databse is in the local machine, and I only know the dbname, can I write the url as jdbc:oracle:thin:@dbname ?
[ April 03, 2002: Message edited by: Mike Yu ]
[ Edited by Dave to fix ]
[ April 03, 2002: Message edited by: David O'Meara ]

Thanks,<br />Mike
Brent Worden
Ranch Hand

Joined: Nov 26, 2001
Posts: 50
I'm sure you can use 'localhost' or '127.0.0.1' for the host.


Brent Worden
Julio Carlos
Greenhorn

Joined: Mar 26, 2002
Posts: 9
The correct way is:
jdbc racle:thin:@localhost:1521:yourdb
You can use 127.0.0.1 or localhost in the connection string
 
 
subject: Connect to a local Oracle database
 
Threads others viewed
Oracle JDBC unable to get connection
JDBC-Oracle
JDBC basic question
Class.forName() for drive using Oracle 8i
about "sid" in url for Oracle connection
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture