• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TNS protocol adapter error

 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kamesh Rao
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Under the services, where is the id located?
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic