• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TNS protocol adapter error

 
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 = "jdbc:odbc:test";

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

}
}
 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Under the services, where is the id located?
 
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic