Oracle 记录下jdbc thin client module名称

Posted xibuhaohao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle 记录下jdbc thin client module名称相关的知识,希望对你有一定的参考价值。

java.util.Properties props = new java.util.Properties();
props.setProperty("password","mypassword");
props.setProperty("user","myusername");
props.put("v$session.osuser", System.getProperty("user.name").toString());
props.put("v$session.machine", InetAddress.getLocalHost().getCanonicalHostName());
props.put("v$session.program", "My Program Name");
DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
Connection conn=
    DriverManager.getConnection("jdbc:oracle:thin:@myhostname:1521:mysid", props);

 

SQL>select username,osuser,program,machine
from v$session
where username = ‘ROB‘; 

USERNAME  OSUSER       PROGRAM             MACHINE
--------- -----------  ------------------  -----------
ROB       rmerkw       My Program Name     machine

At application level you can use the following methods to set client_info, module and action in v$session:

dbms_application_info.set_client_info
dbms_application_info.set_module
dbms_application_info.set_action

以上是关于Oracle 记录下jdbc thin client module名称的主要内容,如果未能解决你的问题,请参考以下文章

JDBC Oracle Thin ORA-02396 连接空闲超时

没有找到适合“jdbc:oracle:thin:@****”oracle/jdbc/driver/OracleDriver”的驱动程序;

(转)jdbc:oracle:thin:@192.168.3.98:1521:orcl(详解)

jdbc连接oracle

找不到适合 jdbc:oracle:thin:@localhost:1521:xe 错误的驱动程序

oracle数据库连接串格式