我正在尝试使用 Oracle TDE 通过以下连接字符串连接到 JDBC 数据源:
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.1.101)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=SECUREDATA)))
有没有办法指定 JDBC 属性,以便为此连接启用透明数据加密?
http://www.orafaq.com/wiki/Network_Encryption#Thin_JDBC_client对如何执行此操作有一些冗长的说明,但由于我们目前拥有的软件架构,我几乎只能修改数据源连接字符串。
Thin JDBC client
In this case, sqlnet.ora file is not read and taken into account; we have to set
properties on the connection.
For example:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Properties props = new Properties();
props.put("oracle.net.encryption_client", "accepted");
props.put("oracle.net.encryption_types_client", "RC4_128");
props.put("user", "XXX");
props.put("password", "YYY");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@myhost:1521:mySID", props);