Home » RDBMS Server » Server Administration » How can I connec to server using only tnsname.ora parameters?
How can I connec to server using only tnsname.ora parameters? [message #59679] Mon, 15 December 2003 23:42 Go to next message
Sheila
Messages: 28
Registered: May 1998
Junior Member
I'm storing host name, port number and service name in an ini file as below:
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = pc3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORADB)
)
)

I want to make my MFC application to connect to Oracle server using only those parameters without connecting oracle client to oracle server using Net8 configuration.
Could you please let me know how can I do that?
Re: How can I connec to server using only tnsname.ora parameters? [message #59683 is a reply to message #59679] Tue, 16 December 2003 02:31 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
i dont understand the requirement.
those entries u have posted are nothing but tnsnames.ora entries ( but u store it in a different file). any sqlnet authenticated connection REQUIRES tnsnames.ora.
If u use JDBC thin client, u no need tnsnames.ora
(connection parameters vary narrowly, u give host,sid,port in the connect string).

Re: How can I connec to server using only tnsname.ora parameters? [message #59694 is a reply to message #59683] Tue, 16 December 2003 19:10 Go to previous messageGo to next message
Sheila
Messages: 28
Registered: May 1998
Junior Member
Thanks for the immediate reply!
I'd just like to know how I can connect to oracle server using host name, port ID and SID?
I want my application to run even if the connection is not created using Net8 configuration.
Re: How can I connec to server using only tnsname.ora parameters? [message #59698 is a reply to message #59694] Wed, 17 December 2003 02:14 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
something like this
      Connection conn = DriverManager.getConnection
              ("jdbc:oracle:thin:@host:port:sid","scott","tiger");

download the thin client from oracle site
please refer Oracle9i JDBC Developer's Guide and Reference for more information

Previous Topic: help
Next Topic: Query Ocasionally hangs
Goto Forum:
  


Current Time: Fri Sep 20 13:42:38 CDT 2024