Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help me please.

Re: Help me please.

From: TurkBear <noone_at_nowhere.com>
Date: Wed, 24 Oct 2001 13:24:36 -0500
Message-ID: <em1ettscs108ccedvprjmkmfm5lpitnf39@4ax.com>


When I used my thin driver, I needed to specify the sid in UPPER CASE or it would fail.. ( That was when I was using JavaScript and ADO, however, so I do not know if it will solve your issue )

Also, as Sybrand points out the default port is 1521   

ftp <shyan_at_cse.cuhk.edu.hk> wrote:

>Sybrand Bakker <postbus_at_sybrandb.demon.nl> wrote:
>
>> "ftp" <shyan_at_cse.cuhk.edu.hk> wrote in message
>> news:9r6q0e$7d2$2_at_eng-ser1.erg.cuhk.edu.hk...
>>> I copy the folloiwng program from oracle hompage
>>> http://technet.oracle.com/doc/java.815/a64685/getsta3.htm#1001200
>>>
>>> import java.sql.*;
>>> import oracle.jdbc.driver.*;
>>>
>>> class JDBCVersion
>>> {
>>> public static void main (String args [])
>>> throws SQLException
>>> {
>>> // Load the Oracle JDBC driver
>>> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>>> Connection conn =
>>>
>> DriverManager.getConnection("jdbc:oracle:thin:@:1588localhost:sid","username
>> ","password");
>>>
>>> // Create Oracle DatabaseMetaData object
>>> DatabaseMetaData meta = conn.getMetaData ();
>>>
>>> // gets driver info:
>>> System.out.println("JDBC driver version is " + meta.getDriverVersion());
>>> }
>>> }
>>>
>>> sid is the sid of my database. username and password is the login username
>>> and password.
>>> I haven't changed the port nubmer. Is it true that the default port is
>>> 1588?
>>>
>>> When I run the program, the following error occur:
>>> java.sql.SQLException: Io exception: The Network Adapter could not
>>> establish the connection
>>> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
>>> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
>>> at
>>> oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java)
>>> at
>>> oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java)
>>> at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
>>> at java.sql.DriverManager.getConnection(Compiled Code)
>>> at java.sql.DriverManager.getConnection(DriverManager.java:126)
>>> at JDBCVersion.main(JDBCVersion.java:11)
>>>
>>> How can I solve the problem?
>>>
>>> --
>
>> By comparing your code and the example carefully. You mixed the host and the
>> port.
>> In your case it should be
>> @localhost:port
>sorry, it is just tying error. The code in my program is @localhost:port
>
>
>> The port is the on which the listener is listening for yoursid, usually
>> 1521.
>> Don't know where you got the 1588 from.
>I have changed the port to 1521, but still get the same error.
>Why? How can I eliminate the error?
>
>Thank you very much!
>
>> Hth,
>
>> Sybrand Bakker
>> Senior Oracle DBA

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!  Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Wed Oct 24 2001 - 13:24:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US