我正在使用此站点上提供的课程:https ://www.oracle.com/technetwork/articles/dsl/jruby-oracle11g-330825.html
我正在设置 SSL,我需要将 java.util.properties 列表传递给驱动程序管理器。
我想我会做这样的事情......
# jdbc_connection.rb
require 'java'
java_import 'oracle.jdbc.OracleDriver'
java_import 'java.sql.DriverManager'
java_import 'java.util.Properties' #<---Import here
class OracleConnection
@conn = nil
def initialize (url)
@url = url
#I want to create the array of properties here and populate it with my SSL properties. I'm really lost here.
# Load driver class
oradriver = OracleDriver.new
DriverManager.registerDriver oradriver
#I want to pass the Properties to DriverManager.
@conn = DriverManager.get_connection url, properties
@conn.auto_commit = false
end
我很想知道如何在 ruby 中创建属性并传递它们。有任何想法吗?
SMILET
相关分类