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

Home -> Community -> Usenet -> c.d.o.misc -> Re: JDBC DB Connection with Eclipse 3.2 and Oracle 10g Express

Re: JDBC DB Connection with Eclipse 3.2 and Oracle 10g Express

From: <ThomasO_at_cpas.com>
Date: 10 Nov 2006 13:56:34 -0800
Message-ID: <1163195794.273571.145340@e3g2000cwe.googlegroups.com>

On Nov 10, 2:24 pm, "ddog" <wgblack..._at_yahoo.com> wrote:
> JDBC connection problem:
>
> The name of the database is HR.
> The server is localhost
> The default port is 1521 (or so I'm told).
> The user name is SYSTEM.
> The password is wgb1454.
> The driver classname is: oracle.jdbc.OracleDriver
> The connection URL is: jdbc:oracle:thin:@localhost:1521:HR
>
> The error message is:
> "Error while trying to login to datbase;
> Listener refused the connection with the
> following error:
> ORA-12505, TNS:listener does not currently
> know of SID given in connect descriptor.
> The connection descriptor used by the client
> was: localhost:1521:HR"
>
> What is TNS:listener? Where is it located?
> What is SID? Where is it defined?
> How are they related and how can you make them recognize each other
> in Win XP Pro?
>
> The Oracle product is Oracle 10g Express. The database I'm trying to
> hit is
> the default demo database that comes with the product.
>
> The connection is NOT written in Java, it's created through a GUI in
> Eclipse 3.2.
>
> Any help would be GREATLY appreciated!

ddog,
If this is Oracle XE than your connection string should be: jdbc:oracle:thin:@localhost:1521:XE
assuming this is standard installation.
where XE is an instance/service name.
In Oracle you connect to the instance, not "database" (IN MS terms). Then use schema name like HR to make queries Example:
If connected as system (You should not do this) select * from HR.<table name> ...
You should read "OracleŽ Database Express Edition Getting Started Guide"
Oracle is different from the database you are familiar with.

HTH
Thomas Received on Fri Nov 10 2006 - 15:56:34 CST

Original text of this message

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