views:

113

answers:

1

hello everybody i have an issue cause i have a java an application which needs to be audited so obviously i need a way in which the app can be identified with the application name so i googled and found that the ojdbc14 has the method .setClientInfo which allows to register the application with a customized name so i am trying to get it work but got the following error:

*Exception in thread "main" java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.setClientInfo(Ljava/lang/String;Ljava/lang/String;)V *

am using ojdbc14 with oracle 10g express if i do not set the line :

connection.setClientInfo("ApplicationName","Customers");

it works pretty well ....AND by checking the audit info i can see that oracle gets the application name:OS_program_name=JDBC Thin Client, but i need a way to change it for a customized name.-

By uncommenting that line which is supposed to set the application name it returns the error above.-

per oracle documentation that method is available for a Connection object , do you have any idea about how to solve this issue?, thanks in advanced.-

+1  A: 

For AbstractMethodError, please check http://stackoverflow.com/questions/1194990/why-do-i-get-java-lang-abstractmethoderror-when-trying-to-load-a-blob-in-the-db

In order to distinguish your connections in Oracle you can use this sample code below:

Properties jdbcProperties = new Properties();

this.jdbcProperties.put("user", userName);
this.jdbcProperties.put("password", password);
this.jdbcProperties.put("v$session.program", "YourApplicationName");
DriverManager.getConnection(url, jdbcProperties);

then check v$session by grouping against program column for your connections..

matafleur
i really appreciate your help man this was really helpful to me...i applied the lines you gave me and it works fine....thanks a lot, sincerely.
enrique
Glad to hear that it worked. One more thing though, this code won't work when you're using oci urls to connect to your Oracle db. It works for just thin urls, I don't understand Oracle about this. At this point you may use DBMS_APPLICATION_INFO package to set module name and action to trace your applications.
matafleur