File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to retrieve Oracle SID from java web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to retrieve Oracle SID from java web application" Watch "How to retrieve Oracle SID from java web application" New topic
Author

How to retrieve Oracle SID from java web application

Bahareh Nikfarjam
Greenhorn

Joined: Oct 23, 2009
Posts: 1
Hello everybody,

Does anybody know of a API that I can use to capture the name of the database that I am connected to? Here is the scenario, I login to my application, now on the first page I want to display the name of the database I am connected to. Let say this is the entry from my tns file:
DATABASENAME =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xxx.xx.xxx)(PORT = 1521))
)
(CONNECT_DATA =
(SID = DATABASENAME)
)
)
I want to display DATABASENAME in UI after I log in.

Thanks in advance!
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2477
    
    7

select name from v$database

I have also seen: select instance_name from v$instance;


OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to retrieve Oracle SID from java web application
 
Similar Threads
Everytime getting an empty ResultSet
Retrieving big list from that database and memory
Retrieving database values inside the <s:select> tag
Connect to the DB from Oracle forms 6i with existing Oracle 8.1.7.0.0 DB.
i m using flex and java and my db is mysql, i want to display image in flex from database