SQL+ connect identifier
Sergio describes on his blog how you can connect with sql+ to to a database without the need of the tnsnames.ora file. This is great, but only available since 10gR1, and you have to provide the password in the connect string.
No related posts.
This entry was posted by Aino Andriessen on October 21, 2005 at 11:37 am, and is filed under Database, Oracle. Follow any responses to this post through RSS 2.0.Both comments and pings are currently closed.
-
Comments are closed
-
1. This is NOT true. You can provide the username and password at the moment you get the connection: DriverManager.getConnection (dbUrl, dbUser, dbPwd);. The username and password should not be part of the url.
2. NOT true either. It is very possible to ‘create’ the jdbc url at runtime based on user’s input or a configuration file. Besides, when you use an Oracle client with a local tnsnames.ora you have to change your configuration too. By the way, web applications offer similar flexibility through the use of DataSources. -
Of course JDBC drivers can be used to connect to the database but in my opinion there are two major disadvantages:
1. Configuration of the driver requires the login credentials in the url which is a potential security risk.
2. If a database is moved to another machine, if the database is renamed, if the port of the listener is changed, if…. any
other change, then the JDBC driver must be reconfigured.IMHO the best practice is to install a minimal runtime client on the machine that is used to connect to an Oracle database.
-
Java clients use JDBC for the database connection and do not rely on an Oracle client. Many Java ide’s, like JDeveloper and Eclipse with the database tools, offer database functionality. Many Java based clients are available, but I do not have a recommendation. In the past I’ve used Squirrel.
But if you need an Oracle client, like TOAD or PLSQL Developer, you can try the Oracle Instant client. -
John Scott posted a nice idea on Sergio’s blog see: http://www.shellprompt.net/~jes/docs/ApacheDBLog.pdf
-
#11 written by Marco Gralike 7 years ago
<code> SQL> connect system/oracle @//vamisnt02:1521/lab Connected. SQL> connect system/oracle @//vamisnt02:1521/lab.amis.nl Connected. SQL> connect system @//vamisnt02:1521/lab.amis.nl SP2-0306: Invalid option. Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where [logon] ::= [username][/[password]][@[connect_identifier]] | / SQL> connect system @"//vamisnt02:1521/lab.amis.nl" Enter password: ****** Connected. SQL> connect system/oracle @(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=vamisnt02.amis.nl)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=LAB))) Connected. </code> - Comment Feed for this Post
Didn't find any related posts :(
You are absolutely right in both statements. However, user input still needs the knowledge of the url and thus knowledge of
IP numbers, ports and so on. And how do we handle those nasty things called ‘overnight batchruns’ where there are no users
available?
BTW, people who are using their own local tnsnames file should be flogged