Problem in connecting with Oracle

hi everybody
I have a problem in connecting with Oracle express 10g. I got an error that doesn't allow me to connect. hope anyone can help me and solve this problem
--------------------Configuration: test - JDK version 1.6.0_20 <Default> - <Default>--------------------
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at DB.dbConnect(test.java:36)
at test.main(test.java:18)
this is the code that I'm following
import java.io.*; import java.sql.*; public class test2 {   public static void main(String[] args) {     try {       Connection con=null;       Class.forName("oracle.jdbc.driver.OracleDriver");       con=DriverManager.getConnection(         "jdbc:oracle:thin:@PLANET:1521:ORCL",         "scott",         "tiger");       Statement s=con.createStatement();       s.execute("INSERT INTO BOOKS VALUES('A Tale of Two Cities','William Shakespeare',4567891231,'05-JAN-1962')");             s.close();       con.close();   } catch(Exception e){e.printStackTrace();} } }
Edited by: Vantasia on Nov 12, 2010 10:18 AM

1. Is the connection url correct?
"jdbc:oracle:thin:@PLANET:1521:ORCL" is fine.
2. Is the TNS listener started?
c:\oracle\product\ora10\bin> lsnrctl status
3. Is a firewall between client and database server?
Connection url with firewall would be different.
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/jdbcthin.htm#i1004276

Similar Messages

  • Problem in connection with oracle

    I've Oracle10g database installed in my system, i wrote a simple application in java that connects to oracle database using oracle thin driver. I've jdk1.6.0_02
        package RegistrationPackage;
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.OracleDataSource;
    public class JDBCVersion {   
        public JDBCVersion() {
        public static void main (String args[])
              throws SQLException
            OracleDataSource ods = new OracleDataSource();
              String url = "jdbc:oracle:thin:@//localhost:1521/orcl";  //1
              ods.setURL(url);//2
              ods.setUser("system");//3
              ods.setPassword("tripathi");
              Connection conn = ods.getConnection();
          // gets driver info:
          //System.out.println("JDBC driver version is " + meta.getDriverVersion());
    }i got following exception
      Exception in thread "main" java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
    The Connection descriptor used by the client was:
    //localhost:1521/orcl
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:380)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:401)
            at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
            at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:839)
            at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:389)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:278)
            at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:199)
            at RegistrationPackage.JDBCVersion.main(JDBCVersion.java:24)
    Java Result: 1I'm sure that problem is in line no. 1.
    I've a bit confusion, i dont know at which port my oracle database server listen through which connection can be made. apparently, I'm not sure about host name however, i used localhost just because a local copy of database server installed in my system.
    please show me the right direction
    regards
    san

    got it!
    actually the was due to incorrect SID.

  • Problem while Connecting with oracle thin driver

    I have been trying for the past two days for connecting oracle 8.1.1.6 using thin driver. I set the classpath also. It throws me the following exception.
    Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap
    ter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
    at java.sql.DriverManager.getConnection(DriverManager.java:177)
    at Employee.main(Employee.java:23)
    I am trying to acheive the connection using the following piece of code
    Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@THIRU:1521:ORCL",
                        "scott", "tiger");
    The problem lies in that piece of code only,
    In the TNSNAMES.ora the entries are as follows.
    THIRU =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Thiru)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = thiru)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    How to solve this one. Can anybody tell me how to provide the proper url.
    thanks in advance

    You were very close.
    "Thiru" as opposed to "THIRU" should be the name of the machine running the database, but that would imply that the DNS lookups are case sensitive, and we know that's not the case.
    My guess, because the network adapter itself is reporting an error, is that "Thiru" evaluates to an IP address that isn't correct, that is, it's trying to make a connection to a specific address and getting nothing back in return.
    Anyway, I think your program(s) are just fine, and your network is misconfigured. Incidently, it is always a good idea in cases like this to use the full name of the machine, for example...
    ...getConnection( "jdbc:oracle:thin:@thiru.maran1977.com:1521:ORCL"...
    and in the database configuration itself...
    (ADDRESS = (PROTOCOL = TCP)(HOST = thiru.maran1977.com)(PORT = 1521))
    You may also use the IP address if you wish.

  • Exmpl of Servlet connect with ORacle

    Hi folks,
    Can anyone send me example of Java Servlet connectivity with Oracle.
    i m not able to connect servlet with oracle.
    u guys can reply me on [email protected]
    thanks
    dal hit

    No.
    The code for connecting to Oracle from a Servlet is no different from connecting to Oracle from any other Java application. So tell you what, you show us what you've tried and the error message(s) and we'll help you debug it.
    99.999% of the time it's a failure to put the driver Jar file into the classpath, the specifics of which vary from application server to application server. Which one are you using?
    u guys can reply me on [email protected]
    We can, but we won't. This is not your personal bugfixing service. Pay if you want that kind of help. If you want it for free, do it through the forums or go away.
    Probably you'll never read this response, but that's your problem not mine.

  • "stack overflow" when trying to connect with Oracle ODBC

    Hi,
    I'm trying to connect to Oracle DB (8.1.7.3.0) from WinNT 4.0 SP6 with Oracle ODBC driver 8.0.6.6.0. I've been trying to connect with "Oracle ODBC Test" and with "MS Query". In either way I end up with Dr. Watson reporting about "stack overflow". Before starting to upgrade ODBC driver I wanted to ask - should these versions of driver and DB work together at all (even unofficially)? Or may I be missing some other thing? Any hints, ideas are welcome.
    Regards,
    Madis Priilinn

    Thank You for replying, Justin!
    Yes, I can connect successfully to the database through other tools - at the moment I tried SQL*Plus, Net8 Easy Config and Schema Manager.
    The Oracle client in the NT machine is 8.0.5.0.0. And unfortunately I do not know anything about the Oracle installation on this machine and at the moment I don't have that person near me too whom to ask also. But I think the installation was ok, because the connection through ODBC was working before the DB upgrade as far as I understood (sorry, again at the moment I don't know what was the previous version of DB. I will ask that information as soon as possible).
    The main problem that bothers me at the moment is that I can't install 8.1.* series OraODBC driver with 8.0.5.0.0 Oracle Installer. I managed to install 8.0.6.6.0 version of the driver, but not the newer ones. As far as I've understood I have to upgrade the whole Oracle in the NT machine to upgrade that installer. Am I correct?
    Regards,
    Madis Priilinn

  • My iPhone 5 got problem when connect with lighting cable, this will keep pop up message "this accessory may not be supported"

    My iPhone 5 got problem when connect with lighting cable, this will keep pop up message "this accessory may not be supported", I can't charge or sync at all. I tried plug and unplug many time, still can't detect/charge my iPhone5, but sometime will 'lucky' that can connect to my iTunes and charge battery…
    This message will auto pop up also when I don't have plug anything in my iPhone 5, It is very annoying…
    The lighting cable is original and now i'm using OS 7.0.4 / iTunes is 11.1.3
    What I can do to fix this problem? Thank you.

    I would try using another cable you can likely borrow one to test from somebody
    if it's the same then likely the connector in your iphone have been damaged

  • I have a problem to connect with FaceTime. I am using OS X 10.9.1 on a Mac PowerBook which is 4 weeks old. I can connect on iPhone but not from my computer.

    I have a problem to connect with FaceTime. I am using OS X 10.9.1 on a Mac PowerBook which is 4 weeks old. I can connect on iPhone but not from my computer. Does anyone have a similar problem???

    The warranty entitles you to complimentary phone support for the first 90 days of ownership.

  • Problem in Connecting with the server

    I have a problem while sitting the e-mail. A message comes saying that the device had a problem in connecting with the server. My BB is Tourch 9860
    Please help me

    Hi gaf4u
    Welcome to BlackBerry Support Forums
    Do you already have any email account integrated with your device ?
    If not then do you have a specific BlackBerry data plan / BIS from your Carier on your account ?
    let us know.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • Problem in connection with sql server

    hi ,
    i am facing problem in connection with ms sql server..please help me out.... i created the database ChandanClient...and there is one table Expense_code_Table...
    i want to insert the data into this table.. i am trying to create a demo example.. here is the code
    package demo;
    import java.sql.*;
    public class getdatabase {
         public static void main(String[] args) {
              Connection con =null;
              int ExpenceCode1=1;
         String ExpenceName1="exp_paper";
         String Organization1="exp_organization";
              try
                   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433");
                   Statement st = con.createStatement();
                   String q1="INSERT INTO Expense_code_Table(ExpenceCode,ExpenceName,Organization)VALUES("+ExpenceCode1+",'"+ExpenceName1+"','"+Organization1+"')";
         st.execute(q1);
              }catch(Exception e)
                   System.out.println(e);
              try
                   con.close();
              catch (SQLException e)
                   e.printStackTrace();
    after running program
    it is showing me...
    java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    java.lang.NullPointerException
         at demo.getdatabase.main(getdatabase.java:22)
    Exception in thread "main"
    please help me out how to solve this problem...
    thanks in advance...
    bye
    chandan sharma

    Put ur driver class files in the class path...
    regards
    Shanu

  • Cannot establish connection with Oracle database

    Hello
    This is the first time I use BOE server with Crystal Report to execute some tests, and one issue is blocking me now, and I am not even sure if this is the right Forum where I should post it.
    I installed BOE server XI 3.1 SP4 on Linux machine (new installation), and then I uploaded some existing Crystal Report templates that are working fine on another BOE server. Those CR templates have to establish a connection with a remote Oracle database to get the data, and we pass all credentials for this purpose.
    The first time I run my first test I received this error that I could not find anywhere on the web :
    ErrorLog 2011  8 10  7:05:52.505 14215 356 (Administrator:82) (../reporthandler.cpp:12462): CReportHandler::buildReportViewerError: CSResultExceFailed to open the connection." FileName:"../reporthandler.cpp" LineNum:12458 ErrorCode:756 ErrorMsg:"Failed to open the connection.
    {FBAD55EE-BEAF-11E0-BC1C-005056813A72}.rpt" DetailedErrorMsg:""
    I believe that the CR was not able to establish the connection with Oracle, so I install Oracle Client on the same machine (test remote connection ==> pass), I set the ORACLE_HOME variable, and I edit the file <installation_home>/ bobje/java/CRConfig.xml to add the path to ojdbc14.jar, and finnaly restart the tomcat server. However I am still getting the same error message.
    Is there any hint that can help me troubleshooting this issue?
    Thank you

    do the reports use native oracle connectivity or JDBC ?
    what version of Oracle client did you install ?
    was it 32bit or 64bit client ?
    what your LD_LIBRARY_PATH variable set to ?
    what does it say in the CMC when you look at CR report's DB properties ?

  • How to connect with Oracle in java

    Hello!
    I would like to use java for my graduation project. And connect with Oracle in java.
    I used j2sdk1.4.2_04 and Oracle 9i release 9.2.0.1.0
    May I ask where could supply me information or content ?
    Thanks!!

    hi jus a sample code
    public class DbUtil {
    // Connection instance
    private static Connection conn = null;
    private Object connection;
    public DbUtil() {
         // Connect to the database
    dbConnect();
    * This method performs the clean up action and closes the application
    void exitDbUtil(){
    // If connected to database
    if (conn != null) {
    try {
    // Close the connection
    conn.close();
    conn=null;
    catch (Exception ex){      // Trap errors
    System.out.println(" Error while Closing the connection: "+ex.toString());
    * Creates a database connection object
    private void dbConnect() {
    try {
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName);
    String url = "jdbc:oracle:thin:@" + ConnectionParams.s_hostName +
              ":" + ConnectionParams.s_portNumber +
              ":" + ConnectionParams.s_databaseSID;
    // Create a connection object
    conn = DriverManager.getConnection(url, ConnectionParams.s_userName,
                             ConnectionParams.s_password);
    catch(Exception e){

  • Using multipool Connections with Oracle 8i OPS Parallel Server

    Does anyone have any experience using multipool JDBC connections with Oracle 8i OPS? During a oracle node failure, we are seeing all of the connections fail. Any help you could give me her would be greatly appreciated!

    hal lavender wrote:
    Hi,
    I am trying to achieve Load Balancing & Failover of Database requests to two of the nodes in 8i OPS.
    Both the nodes are located in the same data center.
    Here comes the config of one of the connection pools.
    <JDBCConnectionPool CapacityIncrement="5" ConnLeakProfilingEnabled="true"
    DriverName="oracle.jdbc.driver.OracleDriver" InactiveConnectionTimeoutSeconds="0"
    InitialCapacity="10" MaxCapacity="25" Name="db1Connection598011" PasswordEncrypted="{3DES}ARaEjYZ58HfKOKk41unCdQ=="
    Properties="user=ts2user" Targets="ngusCluster12,ngusCluster34" TestConnectionsOnCreate="false"
    TestConnectionsOnRelease="false" TestConnectionsOnReserve="true" TestFrequencySeconds="0"
    TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:oracle:thin:@192.22.11.160:1421:dbinst01" />
    <JDBCConnectionPool CapacityIncrement="5" ConnLeakProfilingEnabled="true"
    DriverName="oracle.jdbc.driver.OracleDriver" InactiveConnectionTimeoutSeconds="0"
    InitialCapacity="10" MaxCapacity="25" Name="db2Connection598011" PasswordEncrypted="{3DES}ARaEjYZ58HfKOKk41unCdQ=="
    Properties="user=ts2user" Targets="ngusCluster12,ngusCluster34" TestConnectionsOnCreate="false"
    TestConnectionsOnRelease="false" TestConnectionsOnReserve="true" TestFrequencySeconds="0"
    TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:oracle:thin:@192.22.11.161:1421:dbinst01" />
    <JDBCMultiPool AlgorithmType="Load-Balancing" Name="pooledConnection598011"
    PoolList="db1Connection598011,db2Connection598011" Targets="ngusCluster12,ngusCluster34" />
    Please let me know , if you need further information
    HalHi Hal. All that seems fine, as it should be. Tell me how you
    enact a failure so that you'd expect one pool to still be good
    when the other is bad.
    thanks,
    Joe

  • The network adapter could not establish the connection with Oracle

    I installed Oracle in my laptop (windows 2008), and install Hyperion 11.1.2, when I configure Hyperion, it pops up with "the network adapter could not establish the connection with Oracle"?

    Hi,
    This usually means that the connection details you have put in for Oracle are incorrect or Oracle can not be contacted.
    Double check your configuration connection details and make sure you can access Oracle using them details.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • DB2 OS400 Connection with Oracle Reports 9i with Windows XP

    Dear Friends
    I have a valid ODBC connection of DB2 OS400 and i am using the same with Crystal Report i want to use the same connection with oracle Reports 9i & Forms 9i.
    The response will be highly appriciated.
    Rgds
    Muhammad Tahir Khan

    duplicate post.
    DB2 OS400 Connection with Oracle Reports

  • Forms 6i is not connecting with Oracle 11g database?

    Forms 6i is not connecting with Oracle 11g database?
    How to resolve this issue?

    Hi,
    Once you installed the Forms and Reports, you need to configure the paramters like tnsnames.ora in you path.
    There will be one folder in the Installation path of Forms and Reports search for tnsnames.ora file..and you need to Updated the file as per the which ORACLE Server you are connecting and then try.. it..
    Default path for forms will be "ORACLE_HOME/net80/admin".. search for tnsnames.ora and modify it..
    - Pavan Kumar N

Maybe you are looking for

  • Why is my iPod dead?? (Brand new iPod)

    Hi! I just bought a 60g Black iPod video, I took it out of the box, used it for about 3 hours then battery needed to be charged, so I plugged it up in my computer before going to sleep. Three hours after I plugged it, I checked on the screen and the

  • Can't open iphoto library from external hard drive

    I'm backing up my enormous iPhoto library to two external hard drives in order to free up space on my computer. Before deleting the photos permanently from the laptop, I wanted to double-check that the copies of the library I made on the two external

  • Quick doubt.. from cursor vairable how to get into page vairable

    Hello i am creating an apex page where i have 2 regions. From the Top region stores all fields entered into the bottom region Text fields like first name and last name and address fields are in region 2(bottom).After region 2, i have a add person but

  • How to install Mac Software Update 10.6, but it doesn't show up

    In order to register my iPhone 5 it says to install the new iTunes software update and in order to install that I need the new mac software version 10.6 but it is saying that there is no software update available?

  • Installing / Using Flash Player on Mac X (10.4.11)

    I spent the better part of the morning on my day off trying to install the required "Flash Player" - followed the steps, closed browser windows, downloaded, installed.  Said it was complete!  Yeah!  SO I GO TO A WEB PAGE THAT REQUIRES THE FLASH PLAYE