On 18.07.10 18:15, Saleem EDAH-TALLY wrote:
Hello,
This concerns getting information from 'inside' Derby through JAVA code called
by a procedure.
The nested connection can be obtained with jdbc:default:connection. However
the URL attributes cannot be retrieved in any way.
Hi,
Maybe it would help if you tell why you want to do this, so people can
suggest a different mechanism if appropriate?
conn.getClientInfo() returns an empty Properties object.
Adding support for getClientInfo is briefly discussed in DERBY-3849 [1].
Would it be helpful in your use case?
conn.getMetaData().getUserName() returns nothing.
Can you obtain the current user name with CURRENT_USER?
The Derby Developper's Guide states the following :
*********************************************************************************
Connection conn = DriverManager.getConnection(
"jdbc:default:connection");
URL attributes are not supported as part of this connection URL. Any URL
attributes specified in a Properties object, user name, or password that are
passed to a java.sql.DriverManager.getConnection() call will be ignored.
*********************************************************************************
I don't want to specify URL attributes. I wish to know how can one retrieve
information about these current URL attributes, namely, SSL mode.
I'm not aware of a way to determine if the connection to the database is
encrypted from within a stored procedure.
Doing so seems a bit "out of spec", which is why I asked what you want
to achieve :)
Regards,
--
Kristian
[1] https://issues.apache.org/jira/browse/DERBY-3849
Also, how can one determine in database-side programming if it's the client
driver or the embedded driver that's in use ? i.e, without parsing the URL
(presence of // would mean client driver in use, else it's embedded driver).
Thank you.