aspose file tools*
The moose likes JDBC and the fly likes how can I know my database name? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how can I know my database name?" Watch "how can I know my database name?" New topic
Author

how can I know my database name?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Hi,
I am trying to connect java with oracle with thin deriver. I have both oracle and java on one machine.


This line works perfectly (doesn't give ClassNotFoundException), taken classes111.zip file into classpath.



What should I write at the place of data base name. I am not creating any database. I am just creating tables directly and even don't know in which database, these tables are getting created.

I tried SYSTEM and SYSDB, but both are not working and giving SQL Exception (network could not establish the connection).

Please help me.

Thanks.
[ November 13, 2005: Message edited by: rathi ji ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Ask the administrator of the database what you should put there.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I can give you a hint, but I don't have Oracvle running locally to check. The database name is also in the s\ervice name, so if you're running oracle locally and it is running at the moment, open a command prompt a type 'net start'. This will list all of the running services. One of the oracle services will have a name in capitals at the end eg OracleSomethingMYDATABASE and the part in capitals is the db name. I think.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by David O'Meara:
I can give you a hint, but I don't have Oracvle running locally to check. The database name is also in the s\ervice name, so if you're running oracle locally and it is running at the moment, open a command prompt a type 'net start'. This will list all of the running services. One of the oracle services will have a name in capitals at the end eg OracleSomethingMYDATABASE and the part in capitals is the db name. I think.


I never tried this command, but I tried services.msc command. It displayed list of services and I found oracleservice_SHREE entry there. But then I tried SHREE at the place of database name but even this didn't work.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Well my db is called 'DEVELOP' and the service is 'OracleServiceDEVELOP'... maybe the underscore is part of your database name!
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by David O'Meara:
Well my db is called 'DEVELOP' and the service is 'OracleServiceDEVELOP'... maybe the underscore is part of your database name!


May be possible. I will try it.

Thanks.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
I tried this code.



It was giving this error:



Please tell me, what can be wrong here?
Thanks.
[ November 22, 2005: Message edited by: rathi ji ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Please don't post the same question to multiple threads. It creates duplicate conversations. You should also create a new thread for new questions rather than continuing old topics.

This duplicate will now be closed.

Dave
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by David O'Meara:
Please don't post the same question to multiple threads. It creates duplicate conversations. You should also create a new thread for new questions rather than continuing old topics.

This duplicate will now be closed.

Dave


Are you sure whatever you are saying is right?
Sri Ram
Ranch Hand

Joined: Oct 03, 2005
Posts: 118
Hi Rathi,
Check the port thro which u are connecting to oracle. By Default it is "1521".
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Originally posted by rathi ji:

Are you sure whatever you are saying is right?


Probably not

Why is the port 1526?
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Sri Ram:
Hi Rathi,
Check the port thro which u are connecting to oracle. By Default it is "1521".



It seems that I was using wrong port number.
I will try this port number (1521) and let you all know.

Thanks a lot.


ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by David O'Meara:


Probably not

Why is the port 1526?


It's Okay David. Actually both questions do look the same at first glance (I copied one from another). But they are different and also related to previous post.

I don't know how and why I am using 1526 but now I will change and try.
Thanks.


[ November 22, 2005: Message edited by: rathi ji ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how can I know my database name?