Two Laptop Bag
The moose likes JDBC and the fly likes connecting to db - Oracle vs MS SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "connecting to db - Oracle vs MS SQL " Watch "connecting to db - Oracle vs MS SQL " New topic
Author

connecting to db - Oracle vs MS SQL

Mikey Kelly
Greenhorn

Joined: Aug 09, 2005
Posts: 18
Hi,
When I connect to my MSSQL database I specify the database name in the url:



So I don't have to give the database names in the queries. When I connect to Oracle (haven't tried it yet!) I specify the SID in the url:



I presume that the SID is one value for the whole database server? If so, when querying my Oracle database, do I have to specify the database name everytime in the query? eg.



instead of simply:



Thanks for illumination...
Mike
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


I presume that the SID is one value for the whole database server? If so, when querying my Oracle database, do I have to specify the database name everytime in the query? eg.

Depends who you connect as and how you set up your schema. Do you have a DBA near you, or are you setting this up yourself? If you don't have a DBA, you will need to read through the "Oracle Database Concepts" documentation which can tell you all about users, roles, privileges, schemas, synonyms etc. Otherwise you will find Oracle very hard to use.
[ August 30, 2005: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 625

You don't need to use username before the table name, if you are accessing as a user who owns tables.
Mikey Kelly
Greenhorn

Joined: Aug 09, 2005
Posts: 18
OK,
I will look into the documentation mentioned.
However, sounds like if the user account I use has "ownership" of the tables in question, with appropriate privileges, I don't need to specify the table name...?

Thanks,
M
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: connecting to db - Oracle vs MS SQL
 
Similar Threads
Using oracle conn. manager - connection refused
WebSphere Applicatrion Developer & Oracle
excepttion in thread "main" java.sql.SQLException: Io exception: The Network Adapter
No suitable driver error when configuring JDBC datasource for Tomcat and Struts
Tomcat 6 + jdbc + Oracle