Hi,
Is it possible to get the oracle server port no from a sql query?
Thanks,
Fell
Hi,
Is it possible to get the oracle server port no from a sql query?
Thanks,
Fell
No, but in order to run a query you're going to need a connection to the DB so I suspect you can get the port using a call to java.sql.DatabaseMetaData.getURL()
. Not sure exactly what the Oracle drivers return but something like this should do the trick:
String url = connection.getMetadata().getURL();
String port = url.substring(url.indexOf(":"), url.indexof("/", url.indexOf(":")) - 1);