Class: PLSQL::Connection
- Inherits:
-
Object
show all
- Defined in:
- lib/plsql/connection.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(raw_drv, raw_conn) ⇒ Connection
Returns a new instance of Connection.
6
7
8
9
|
# File 'lib/plsql/connection.rb', line 6
def initialize(raw_drv, raw_conn)
@raw_driver = raw_drv
@raw_connection = raw_conn
end
|
Instance Attribute Details
#raw_connection ⇒ Object
Returns the value of attribute raw_connection.
3
4
5
|
# File 'lib/plsql/connection.rb', line 3
def raw_connection
@raw_connection
end
|
#raw_driver ⇒ Object
Returns the value of attribute raw_driver.
4
5
6
|
# File 'lib/plsql/connection.rb', line 4
def raw_driver
@raw_driver
end
|
Class Method Details
.create(raw_conn) ⇒ Object
11
12
13
14
15
16
17
18
19
|
# File 'lib/plsql/connection.rb', line 11
def self.create(raw_conn)
if !raw_conn.respond_to?(:java_class) && defined?(OCI8)
OCIConnection.new(:oci, raw_conn)
elsif raw_conn.respond_to?(:java_class) && raw_conn.java_class.to_s =~ /jdbc/
JDBCConnection.new(:jdbc, raw_conn)
else
raise ArgumentError, "Unknown raw driver"
end
end
|
Instance Method Details
#autocommit=(value) ⇒ Object
45
46
47
|
# File 'lib/plsql/connection.rb', line 45
def autocommit=(value)
raise NoMethodError, "Not implemented for this raw driver"
end
|
#autocommit? ⇒ Boolean
41
42
43
|
# File 'lib/plsql/connection.rb', line 41
def autocommit?
raise NoMethodError, "Not implemented for this raw driver"
end
|
#commit ⇒ Object
33
34
35
|
# File 'lib/plsql/connection.rb', line 33
def commit
raise NoMethodError, "Not implemented for this raw driver"
end
|
#exec(sql, *bindvars) ⇒ Object
57
58
59
|
# File 'lib/plsql/connection.rb', line 57
def exec(sql, *bindvars)
raise NoMethodError, "Not implemented for this raw driver"
end
|
#jdbc? ⇒ Boolean
25
26
27
|
# File 'lib/plsql/connection.rb', line 25
def jdbc?
@raw_driver == :jdbc
end
|
#logoff ⇒ Object
29
30
31
|
# File 'lib/plsql/connection.rb', line 29
def logoff
raise NoMethodError, "Not implemented for this raw driver"
end
|
#oci? ⇒ Boolean
21
22
23
|
# File 'lib/plsql/connection.rb', line 21
def oci?
@raw_driver == :oci
end
|
#parse(sql) ⇒ Object
61
62
63
|
# File 'lib/plsql/connection.rb', line 61
def parse(sql)
raise NoMethodError, "Not implemented for this raw driver"
end
|
#rollback ⇒ Object
37
38
39
|
# File 'lib/plsql/connection.rb', line 37
def rollback
raise NoMethodError, "Not implemented for this raw driver"
end
|
#select_all(sql, *bindvars, &block) ⇒ Object
53
54
55
|
# File 'lib/plsql/connection.rb', line 53
def select_all(sql, *bindvars, &block)
raise NoMethodError, "Not implemented for this raw driver"
end
|
#select_first(sql, *bindvars) ⇒ Object
49
50
51
|
# File 'lib/plsql/connection.rb', line 49
def select_first(sql, *bindvars)
raise NoMethodError, "Not implemented for this raw driver"
end
|