Connecting to Oracle using JDBC

Hi all,
I am a new to Oracle. I am trying to connect to Oracle using JDBC
The URL with which I tried to connect was:
jdbc:oracle:oci8:@myServiceName,user='myLogin',password='myPassword'
I get an error (ORA-12154)
- TNS could not resolve service name
When I use the same userid, password and service and connect thru' SQL*Plus it goes thru'. Is there any parameter which I am missing. Can anyone throw some light on this. I am held up with this issue badly.
Thanks for all your help and time.
Regards,
Latha

Hi Latha,
Please try to use thin and add port number.
m_conn = DriverManager.getConnection("jdbc:oracle:thin:@" + hostURL + ":" + port + ":" + database, user, password);
Hong
null

Similar Messages

  • Connecting to Oracle using JDBC problem

    When trying to connect using the following few lines:
              String urn = "jdbc:oracle:thin:@localhost:1521:XE";
              Class.forName("oracle.jdbc.driver.OracleDriver");
              Connection _con = DriverManager.getConnection(urn, "user", "pass");
    I get an ArrayIndexOutOfBounds Exception
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7
         at oracle.security.o3logon.C1.r(C1)
         at oracle.security.o3logon.C1.l(C1)
         at oracle.security.o3logon.C0.e(C0)
         at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
         at oracle.jdbc.ttc7.O3log.<init>(O3log.java:287)
         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:227)
         at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
    I am using JDK 1.4, and I installed the Oracle Database 10g Express Edition.
    If anyone has used JDBC before, and knows how this should be done...
    thanks

    Hi All,
    Even im facing similar issues, please advise and help. Details as below,
    System and java spec used:
    Windows Edition : Windows Server 2008 R2 Standard
    System type : 64-bit Operating System
    NetBeansIDE version : 6.1
    JDK Version : 1.6
    DB : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Connection string: : <root>
    <title>Oracle R12 Prod</title>
    <jdbc-connection-string>jdbc:oracle:thin:<username>/<password>@<host>:<port>:<SID></jdbc-connection-string>
    </root>
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.ArrayIndexOutOfBoundsException: 7
    at oracle.security.o3logon.C1.r(C1)
    at oracle.security.o3logon.C1.l(C1)
    at oracle.security.o3logon.C0.c(C0)
    at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
    at oracle.jdbc.ttc7.O3log.<init>(O3log.java:290)
    at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at db.dbConnect.makeConnection(dbConnect.java:55)
    at org.apache.jsp.rep.rep1_005fgo_jsp._jspService(rep1_005fgo_jsp.java from :222)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:660)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:578)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:997)
    at org.apache.jsp.rep.rep1_005fgo0_jsp._jspService(rep1_005fgo0_jsp.java from :111)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

  • Connecting to Oracle using JDBC issue

    Hi All,
    Im facing similar issues, please advise and help. Details as below,
    System and java spec used:
    Windows Edition : Windows Server 2008 R2 Standard
    System type : 64-bit Operating System
    NetBeansIDE version : 6.1
    JDK Version : 1.6
    DB : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Connection string: : <root>
    <title>Oracle R12 Prod</title>
    <jdbc-connection-string>jdbc:oracle:thin:<username>/<password>@<host>:<port>:<SID></jdbc-connection-string>
    </root>
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.lang.ArrayIndexOutOfBoundsException: 7
    at oracle.security.o3logon.C1.r(C1)
    at oracle.security.o3logon.C1.l(C1)
    at oracle.security.o3logon.C0.c(C0)
    at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
    at oracle.jdbc.ttc7.O3log.<init>(O3log.java:290)
    at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    at db.dbConnect.makeConnection(dbConnect.java:55)
    at org.apache.jsp.rep.rep1_005fgo_jsp._jspService(rep1_005fgo_jsp.java from :222)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:660)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:578)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:997)
    at org.apache.jsp.rep.rep1_005fgo0_jsp._jspService(rep1_005fgo0_jsp.java from :111)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

    Can someone please help me on the above query

  • Connect to oracle using jdba thin driver

    i want to use jdbc thin driver to connect to oracle 8i for linux intel.
    my code is:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String dbURL = "jdbc:oracle:thin:@dbserver:1521:iasdb";
    Connection con = DriverManager.getConnection(dbURL,"scott","tiger");
    but an error is reported as "the network adapter can not establish connection".
    why?
    i can connect to oracle using JDBC-ODBC bridge successfully.

    i want to use jdbc thin driver to connect to oracle 8i for linux intel.
    my code is:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String dbURL = "jdbc:oracle:thin:@dbserver:1521:iasdb";
    Connection con = DriverManager.getConnection(dbURL,"scott","tiger");
    but an error is reported as "the network adapter can not establish connection".
    why?
    i can connect to oracle using JDBC-ODBC bridge successfully.

  • How do I connect to Oracle with JDBC using "dedicated processor".

    Because of performance problems we want to try to connect to
    oracle using dedicated processor. We can do this from SQL Plus,
    does anybody know what we need to set up in order to utilize
    this from JDBC?

    Which Java runtime error? (stack trace?)

  • Cannot connect to database using JDBC

    Hello!
    I am trying to connect to my local database using this script:
    import java.sql.*;
    public class test{
    public static void main (String[] args){
      try
        DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
        Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
        Statement StmtPersoane = conn.createStatement();
        ResultSet CrsPersoane =StmtPersoane.executeQuery("select p.* from personal p");
        int jMarca = 0;
        while(CrsPersoane.next()){
        jMarca = CrsPersoane.getInt("marca");
        System.out.println(jMarca);
        CrsPersoane.close();
        StmtPersoane.close();
        conn.close();
      catch(SQLException e)
        e.printStackTrace();
    }When compiling i am getting this error: Error(7,58): cannot access class oracle.jdbc.driver.OracleDriver; file oracle\jdbc\driver\OracleDriver.class not found
    I have set a CLASSPATH enviroment variable with value : D:\oracle10g\product\10.1.0\Db_1\jdbc\lib\ojdbc14.jar
    Please provide some hints. Thanks in advace !

    Problem solved with the connection, but now i'm getting another error when i am trying to parse an error. Here is the code a little bit modified:
    import java.sql.*;
    import java.text.*;
    import java.text.ParseException;
    import java.util.*;
    public class test{
    public static void main (String[] args){
      try
        DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
        Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
                Statement StmtPersoane;
                StmtPersoane = conn.createStatement();
                ResultSet CrsPersoane =StmtPersoane.executeQuery("select marca from personal");
                int jMarca;
                jMarca = 0;
    java.util.Date dataJava = new java.text.SimpleDateFormat("dd/mm/yyyy").parse("04/10/2006");
    java.sql.Date dataSql = new java.sql.Date(dataJava.getTime());
    System.out.println("Data: "+dataSql);
        System.out.println("Angajatii sunt:"); 
                while(CrsPersoane.next()){
        jMarca = CrsPersoane.getInt("marca");
        System.out.println(jMarca);
        CrsPersoane.close();
        StmtPersoane.close();
        conn.close();
      catch(SQLException e)
        e.printStackTrace();
    }The error:
    Error(24,81): unreported exception: java.text.ParseException; must be caught or declared to be thrown
    Any ideas ?

  • User permission issue in connecting to Oracle using java in Cent OS

    Hi ,
    I am facing a peculiar issue and since I am new to Cent OS, I hope somebody can help me.
    I am using Cent OS 4.2 and I installed Oracle client 10.2 in cent os 4.2.
    I am having a java application which connects to Oracle server in another Linux system using Oracle OCI driver which comes along with Oracle client
    I have a user called user1 which belongs to group group1 as primary group and my application runs under this user user1.
    This user is a member of oinstall group (which is the group for oracle uesr which has access to oracle client directories/files)
    But when my application tries to connect to Oracle server, I am getting connectivity error saying "Oracle driver not found" or "cannot load libocijdbc10.so". All environment variables like ORACLE_HOME, PATH,CLASSPATH, LD_LIBRARY_PATH are set properly.
    The permissions to Oracle folder/files are rwx for owner(oracle user) , rx for group(oinstall) and none for others
    What we observed are
    1. When the application is start under root user, it works
    2. When we give rx permission to others, it works
    3. When we make oinstall group as the primary group for my user user1, it works
    My questions here
    1. Why it is not working even though my user user1 is a member of oinstall group
    2. Why it is working when I make oinstall as the primary group
    3. Is there any difference in security policy of RHEL and Cent OS
    4. How can I access libraries from multiple folders which created by different user and belongs to different groups, if this is the case
    I never faced this issue in RHEL4
    Hope some body can help me.
    Regards
    Sunil

    Sorry, I should have been more specific. The error message I was referring to shows up in a pop-up windows when I try to run the program. The actual java error message (that shows up in the command prompt window) is as follows:
    "Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\WINNT\system32\ocijdbc8.dll: The specified procedure could not be found
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1397)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:832)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:192)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:142)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:214)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:193)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at lookup.main(lookup.java:16)"
    I'm running the program through Windows 200 Pro command prompt, and the version of java is, as I mentioned in the previous message, 1.4.1:
    java -version
    java version "1.4.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
    Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

  • Error in connection to oracle using java

    hi ,
    i am tring to make a connection to oracle database using java with this code
    public class DataBase {
    public DataBase(){
    Connection connection = null;
    try {
    // Load the JDBC driver
    String driverName = "oracle.jdbc.dirver.OracleDriver";
    Class.forName(driverName);
    // Create a connection to the database
    String serverName = "http://localhost:7777";
    String portNumber = "1521";
    String sid = "ora9i";
    String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
    String username = "scott";
    String password = "tiger";
    connection = DriverManager.getConnection(url, username, password);
    } catch (ClassNotFoundException e) {
    JOptionPane.showMessageDialog(null,"Coud not find the database driver ");
    // Could not find the database driver
    } catch (SQLException e) {
    JOptionPane.showMessageDialog(null,"Coud not connect to the database ");
    // Could not connect to the database
    public static void main(String[] args) {
    new DataBase();
    i always got the compilation error Coud not find the database driver
    i am using oracle9i and jdk1.5.0_04 and my classpath is C:\oracle\ora92\jdbc\lib\ojdbc14.zip;C:\oracle\ora92\jdbc\lib\orai18n.zip
    i am realy stuck with this so any one can help me with this probelm
    thanks alot,

    thanks for your reply,
    yes i changed the server name and i verified the location of the JDBC driver file(s) on my computer. any way i solved my problem.
    you know there was a misunderstanding in what you mean by classpath, i thought that i have to change the classpath from control panel>system>advance>enviroment variable
    and then select classpaht and edit it. i was doing this but this is didn't work.
    then i don't know why i did that
    i went to java program and select my project,right click on it and then select properties>java build path and then select "add external Jars" button and then i simply choose them and add them to my project. and finaly it worked.
    thanks alot

  • Unable to connect to oracle using type4 driver

    hi
         I was trying to connect to oracle Database using type 4 thin drivers on win98.
         I downloaded the driver from oracle site and also downloaded some more drivers
         from other sites.While connecting to data base I ran into problems I am working
         for about two days on this thing but couldn't succeed.
         I get the following message:
              Connection refused ...........
         The driver is succefully loaded but when it tries to connect using
         conn = DriverManager.getConnection("jdbc:oracle:thin:@server:1521:orcl","userid","password");
         it gives the above message.
         now I think that I am giving the host name incorrect I couldn't find
         any way in oracle to figure out the host name.
         I am giving
                   "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
              I have also tried other options for host name like localhost etc.but it
         didn't resolve.I think that the listener for oracle is not listening at the port 1521.
         I tried telnet to check that but it failed to connect at this port.I tried to do this
         with mysql to connect at port 3306 using telnet it succeeded.
              Second thing is that I tried to create a service name in oracle using TCP/IP protocol
         giving the above mentioned host names at all the attempts it gave the error that it has performed
         an illegal operation .
              I think that there are some settings needed for oracle to listen at this port which
         I dont know or I am giving the host name wrong . I shall be extremely thankful if u help
         me to solve this problem.
                                       Regards
                                                 shAhzad      

    It has been a long time since I tried to run Oracle on Win98 (or Win95) for that matter, but I don't believe that there is a listener in the traditional sense since you would be using Personal Oracle. Your first step should be to make sure you can login to Oracle using the standard client and SQLPLUS. You could then use TNSPING to see if the listener is listening (you will need to setup TNSNAMES.ORA properly but you can use the Net8 Assistant or whatever). Next I would suggest you try using the OCI client instead of the thin client.
    If you can, it would be much better to install Oracle on an NT, Win2K, or Linux machine. Oracle on Win98 is not really the same thing.

  • I am unable to connect to oracle using thin driver

    Hi,
    I am writing a program to connecto database using thih driver,by using ipadress of server where oracle 8i is installed.I am getting an error
    Exception in thread "main" java.sql.SQLException: No suitable driver
    How to over come this.Any one please help me.

    I am getting error saying No suitable driver found
    this is my function:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection cn=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.112:1521:orcle8i","scott","tiger");
    oracle 8i is my database name.I have created another database name with oracle in the server. will it cause any problem.

  • Problem with connect to oracle by jdbc

    hi,
    First time i try to connect to the oracle db 10.2.0* EE in java and its problem. I use eclipse 3.4, jre1.5.0_17, driver ojdbc14.jar (dedicated to this oracle ver and jre).
    package connect;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class JDBC_Conn {
            void polaczenie_z_baza() throws SQLException {
                try {
                    Class.forName("oracle.jdbc.driver.OracleDriver");  
                    System.out.println("connected");      
                } catch (Exception e) {
                    System.out.println("not connected");
                Connection polaczenie=DriverManager.getConnection("jdbc:oracle:thin:@3.123.123.321:1521:RI3","user","pass");
    public static void main(String[] args){
         JDBC_Conn b = new JDBC_Conn();
            try {
                    b.polaczenie_z_baza();
            } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
    }and after run in console i see: "connected" but after 2 seconds i see error:
    java.sql.SQLException: Wyj&#261;tek we-wy: 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:439)
         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(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at connect.JDBC_Conn.polaczenie_z_baza(JDBC_Conn.java:18)
         at connect.JDBC_Conn.main(JDBC_Conn.java:24)This is important that i can login to the database by pl/sql developer using tnsnames.ora like this:
    CIF2 =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 3.123.123.321)(PORT = 1521))
        (CONNECT_DATA =
          (SID = RI3)
      )but when im logging by plsql developer i need to enter the name of database "DWH" too, another i cant login. The same when i log by sql plus, i need to enter the: user@DWH.
    So please tell me could i add to this string:
    "jdbc:oracle:thin:@3.123.123.321:1521:RI3","user","pass"
    the DWH database? where i should to put it?
    i try a lot of cases and cant login
    thanks for help

    i put:
    String url = "jdbc:oracle:thin:"+user+"/"+pass+"@blahblahblah:blah:blah";
                    System.out.println( url );
                    Connection con = DriverManager.getConnection( url );and i have:
    not connected
    jdbc:oracle:thin:user/password@blahblahblah:blah:blah
    java.sql.SQLException: Wyj&#261;tek we-wy: Invalid number format for port number
         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:439)
         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(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at connect.JDBC_Conn.polaczenie_z_baza(JDBC_Conn.java:27)
         at connect.JDBC_Conn.main(JDBC_Conn.java:37)the pass and user name i put corectly..
    is it possible that DBA did some restrict to access DB?
    Edited by: pawelwtorek on 2009-03-19 16:59

  • How to store .doc file in oracle using jdbc

    Here is problem , storing microsoft excel file (or) .txt file to database(ORACLE) through JDBC .
    how to retrive

    Congratulations! You are the one millionth person to ask how to store files in databases without searching for previous threads.
    What do you win?
    A hearty smack in the forehead and a strenuous endorsement to use Google, search and find the answer.

  • Wierd message while connecting to ORACLE using sqlplus

    Hi
    Server:AIX 3 5
    Oracle: 10.2.0.1 patched to 10.2.0.3
    i tried connecting to oracle and getting a wierd error only via OS Authenticated user not while connecting as sys or "/ as sysdba"
    $ sqlplus /
    1224868 : map : Permission Denied
    1224868 : map : Permission Denied
    1224868 : map : Permission Denied
    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Nov 27 00:40:18 2007
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    any idea on this?
    thanks
    Deepak

    Server:AIX 3 5Is it true or mistake ? I don't think Oracle 10g has ever supported on that AIX version.
    Anyway, what OS user did you use ?
    Nicolas.

  • Direct connect to Oracle using Delphi

    How I can direct connect and transfer data from Oracle Database using Delphi.
    Not via ODBC driver!!!

    There are several BDE replacements that allow you to connect to
    Oracle from Delphi with out BDE or ODBC
    DOA- Direct Oracle Access from Allaround Automation ~$200.00
    http://www.allroundautomations.nl/index.html
    NCOCI8 is freeware.
    Goto to www.kylecords.com and they list BDE replacements.
    I use DOA and their PL/SQL developer systems from Allaround
    Automations and they are both excellent systems with excellent
    support.

  • Problem connect to oracle using ORACE

    Hi,
    Has anybody been able to connect to Oracle 10g using the latest ORACE(Free PL/SQL code editor)? The application hangs when I click on connect. Do I have to install the Oracle Instant Client if I have Oracle 10g Enterprise Edition installed?
    Any sort of help would be greatly appreciated.

    Do I have to install the Oracle Instant Client if I have Oracle 10g Enterprise Edition installed?
    No, But make sure that ORACLE_HOME variable is set correctly.
    What is the name of the PL/SQL editor you want to use?
    You can try SQL Developer.It is free as well.

Maybe you are looking for