Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Have host (Tnsname), need Machine:Port:Sid in PL/SQL ?
Douglas,
thanks for your input!
Yes I know there can be many tsnnames. I am intrested in the one which is used if I start sqlplus on the local machine eg sqlplus scott/tiger_at_orcl
The reason why I am after this is a migration of our application form OCI8 to JDBC connections:
Till now, it was pretty much script based, and one "administration schema" was holding the available data schemas. including username and host. This was done to allow our application (GUI) to present a list of available schemas holding data.
But now, we migrated the application to something java based, using jdbc rather then oci8 to access oracle. hence, in the "admin schema", we need these machine:1521:sid strings stored rather then the host (and of course a proper tnsnames).
This replacemnet (host replaced by machine:port:sid should be done only once during the migration.
Another way would be defining and filling a table with all hosts and corresponding jdbc information. However, it would be cooler to do it automatically.
Regards
Christof
>>Christof >>