aspose file tools*
The moose likes JDBC and the fly likes TNS protocol adapter error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "TNS protocol adapter error" Watch "TNS protocol adapter error" New topic
Author

TNS protocol adapter error

Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 437
Hi,
Using servlet, i am trying to connect to the Oracle database. I get the following error.


12:19:09,181 ERROR [STDERR] [Microsoft][ODBC driver for Oracle][Oracle]ORA-12560
: TNS:protocol adapter error

Can you tell me the cause of the error and how it can be rectified?

With regards,
Padma priya


Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

I think that problem occur because of not specified the database name in your connection String. Can you paste your code here to find out better where the error is occur.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Kamesh Rao
Ranch Hand

Joined: Dec 24, 2006
Posts: 35
See whether the service id specfied in the url of the connection is running or not.
This can be checked in windows by clicking on
settings-->controlpanel-->Administrative Tools-->services
Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 437
Hi,
The name of the system dsn is "test".



private void getDatabaseConnection() {
try {

// Step 1: Load the JDBC driver.

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

// Step 2: Establish the connection to the database.

String url = "jdbcdbc:test";

Connection conn= DriverManager.getConnection(url,"ppmapp","ppmapp8759");

}
}
Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 437
Under the services, where is the id located?
Baseet Ahmed
Ranch Hand

Joined: Dec 18, 2006
Posts: 224
Hello,
First use SQL Plus to check the connectivity with Oracle.
If it is not working then check whether your ORACLE_SID variable is set or not.
If not set it with the value which you have given at the time of Installation for SID.


Thanks.
Subhadip Chatterjee
Ranch Hand

Joined: Dec 12, 2006
Posts: 93
Hi Guru,
i guess, if you have already registered a DSN name for the DB (IS it Oracle?), then from windows(I hope your's is a windows system)->control panel->admin tools->data sources(ODBC), you can test your connection. [I am sure you know this process]. Other than that, you are using Type 1 driver, so no need to think about any SID stuff to connect to Oracle, your code is Ok.


Refreshing life every moment...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TNS protocol adapter error