simpleOracleJDBC 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +173 -34
- data/lib/simple_oracle_jdbc/#bindings.rb# +214 -0
- data/lib/simple_oracle_jdbc/db_call.rb +20 -2
- data/lib/simple_oracle_jdbc/sql.rb +1 -0
- metadata +48 -29
data/README.md
CHANGED
@@ -1,64 +1,203 @@
|
|
1
|
-
#
|
1
|
+
# A Thin Wrapper
|
2
2
|
|
3
|
-
|
3
|
+
The idea behind this gem is that it provides a thin wrapper around a JDBC connection. It provides an interface to quickly execute SQL statements and stored procedures, but leaves the raw JDBC connection available if anything more complicated is required, such as binding array types.
|
4
4
|
|
5
|
-
|
5
|
+
Values can be bound to SQL statements and procedures by simple passing an array of Ruby types into the excecute call, and they are mapped automatically into the correct Java SQL types. The same happens when values are returned from procedures and queries.
|
6
|
+
|
7
|
+
# More Than Just Testing
|
8
|
+
|
9
|
+
While the gem was created to help with Unit Testing PLSQL code, there is nothing preventing it being used for other quick scripts or prototypes. I haven't looked at performance at all, so if you decided to use it in a production application, test it thoroughly first!
|
10
|
+
|
11
|
+
# Requirements
|
6
12
|
|
7
13
|
This gem will only work with JRuby as it uses the Java JDBC interface.
|
8
14
|
|
9
15
|
The Oracle JDBC drivers (ojdbc6.jar) need to be in the JRuby lib directory.
|
10
16
|
|
11
|
-
|
17
|
+
# Usage
|
12
18
|
|
13
|
-
The
|
19
|
+
The best way to learn how to use Simple Oracle JDBC is to read through the sample code below, and then checkout the documentation.
|
14
20
|
|
15
|
-
require 'rubygems'
|
16
21
|
require 'simple_oracle_jdbc'
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
|
23
|
+
conn = SimpleOracleJDBC::Interface.create('sodonnell', # user
|
24
|
+
'sodonnell', # password
|
25
|
+
'tuned', # service
|
26
|
+
'192.168.0.1', # host
|
27
|
+
'1521') # port
|
28
|
+
|
23
29
|
# ... or create with an existing JDBC connection
|
24
|
-
#
|
25
|
-
|
30
|
+
# conn = SimpleOracleJDBC.create_with_existing_connection(conn)
|
31
|
+
|
26
32
|
# Create a SimpleOracleJDBC::SQL object
|
27
|
-
sql =
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
#
|
33
|
+
sql = conn.prepare_sql("select 1 c1, 'abc' c2, sysdate c3, 23.56 c4
|
34
|
+
from dual
|
35
|
+
where 1 = :b1
|
36
|
+
and 2 = :b2")
|
37
|
+
|
38
|
+
# execute the query against the database, passing any binds as required
|
39
|
+
sql.execute(1, 2)
|
40
|
+
|
41
|
+
# get the results back as an array of arrays. Note that the resultset
|
42
|
+
# and statement will be closed after this call, so the SQL cannot
|
43
|
+
# be executed again.
|
33
44
|
results = sql.all_array
|
34
|
-
puts "The returned row is #{results[0]
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
#
|
45
|
+
puts "The returned row is #{results[0]}"
|
46
|
+
|
47
|
+
# > The returned row is [1.0, "abc", 2013-02-12 22:00:23 +0000, 23.56]
|
48
|
+
|
49
|
+
# Run the same SQL statement again
|
50
|
+
sql = conn.prepare_sql("select 1 c1, 'abc' c2, sysdate c3, 23.56 c4
|
51
|
+
from dual
|
52
|
+
where 1 = :b1
|
53
|
+
and 2 = :b2")
|
54
|
+
|
55
|
+
sql.execute(1, 2)
|
56
|
+
|
57
|
+
# This time fetch the results as an array of hashes
|
58
|
+
results = sql.all_hash
|
59
|
+
puts "The returned row is #{results[0]}"
|
60
|
+
puts results[0]["C3"].class
|
61
|
+
|
62
|
+
# Notice how the column names are the keys of the hash, and the date is converted
|
63
|
+
# into a Ruby Time object.
|
39
64
|
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
|
65
|
+
# > The returned row is {"C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:03:02 +0000, "C4"=>23.56}
|
66
|
+
# > Time
|
67
|
+
|
68
|
+
# If you need to iterate over a large result set, then pass a block to the each_array
|
69
|
+
# or each_hash method
|
70
|
+
sql = conn.prepare_sql("select level rnum, 1 c1, 'abc' c2, sysdate c3, 23.56 c4
|
71
|
+
from dual
|
72
|
+
where 1 = :b1
|
73
|
+
and 2 = :b2
|
74
|
+
connect by level <= 4")
|
75
|
+
|
76
|
+
sql.execute(1, 2).each_hash do |row|
|
77
|
+
puts row
|
78
|
+
end
|
79
|
+
|
80
|
+
# > {"RNUM"=>1.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:07:14 +0000, "C4"=>23.56}
|
81
|
+
# > {"RNUM"=>2.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:07:14 +0000, "C4"=>23.56}
|
82
|
+
# > {"RNUM"=>3.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:07:14 +0000, "C4"=>23.56}
|
83
|
+
# > {"RNUM"=>4.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:07:14 +0000, "C4"=>23.56}
|
84
|
+
|
85
|
+
# Finally you can ask for each row one at a time, with each_array or each_hash
|
86
|
+
sql = conn.prepare_sql("select level rnum, 1 c1, 'abc' c2, sysdate c3, 23.56 c4
|
87
|
+
from dual
|
88
|
+
where 1 = :b1
|
89
|
+
and 2 = :b2
|
90
|
+
connect by level <= 4")
|
91
|
+
sql.execute(1, 2)
|
92
|
+
|
93
|
+
# If you fetch to the end of the result set, then the statement and
|
94
|
+
# and result set will be closed. Otherwise, call the close method:
|
95
|
+
#
|
96
|
+
# sql.close
|
97
|
+
while row = sql.next_array do
|
98
|
+
puts "The row is #{row}"
|
99
|
+
end
|
100
|
+
|
101
|
+
# > The row is [1.0, 1.0, "abc", 2013-02-12 22:11:38 +0000, 23.56]
|
102
|
+
# > The row is [2.0, 1.0, "abc", 2013-02-12 22:11:38 +0000, 23.56]
|
103
|
+
# > The row is [3.0, 1.0, "abc", 2013-02-12 22:11:38 +0000, 23.56]
|
104
|
+
# > The row is [4.0, 1.0, "abc", 2013-02-12 22:11:38 +0000, 23.56]
|
105
|
+
|
106
|
+
|
107
|
+
# Executing Stored Procedures is easy too, just take care of out and inout parameters.
|
108
|
+
#
|
109
|
+
# create or replace function test_func(i_var integer default null)
|
110
|
+
# return integer
|
111
|
+
# is
|
112
|
+
# begin
|
113
|
+
# if i_var is not null then
|
114
|
+
# return i_var;
|
115
|
+
# else
|
116
|
+
# return -1;
|
117
|
+
# end if;
|
118
|
+
# end;
|
119
|
+
# /
|
120
|
+
#
|
121
|
+
# Execute a function with a returned parameter. Notice how the
|
122
|
+
# out/returned parameter is passed as a 3 element array.
|
123
|
+
# The first element defines the Ruby type which is mapped into a SQL type as follows:
|
124
|
+
#
|
125
|
+
# RUBY_TO_JDBC_TYPES = {
|
126
|
+
# Date => OracleTypes::DATE,
|
127
|
+
# Time => OracleTypes::TIMESTAMP,
|
128
|
+
# String => OracleTypes::VARCHAR,
|
129
|
+
# Fixnum => OracleTypes::INTEGER,
|
130
|
+
# Integer => OracleTypes::INTEGER,
|
131
|
+
# Bignum => OracleTypes::NUMERIC,
|
132
|
+
# Float => OracleTypes::NUMERIC,
|
133
|
+
# :refcursor => OracleTypes::CURSOR
|
134
|
+
# }
|
135
|
+
#
|
136
|
+
# The second element is the value, which should be nil for out parameters and can take a
|
137
|
+
# value for inout parameters.
|
138
|
+
#
|
139
|
+
# The third parameter should always be :out
|
140
|
+
#
|
141
|
+
# Also notice how the value is retrieved using the [] method, which is indexed from 1 not zero.
|
142
|
+
# In, out and inout parameters can be accessed using the [] method.
|
143
|
+
proc = conn.prepare_proc("begin :return := test_func(); end;")
|
47
144
|
proc.execute([String, nil, :out])
|
48
145
|
puts "The returned value is #{proc[1]}"
|
146
|
+
|
147
|
+
# > The returned value is -1
|
148
|
+
|
149
|
+
# To pass parameters into the function, simply pass plain Ruby values:
|
150
|
+
proc = conn.prepare_proc("begin :return := test_func(:b1); end;")
|
151
|
+
proc.execute([String, nil, :out], 99)
|
152
|
+
puts "The returned value is #{proc[1]}"
|
153
|
+
proc.close
|
154
|
+
|
155
|
+
# > The returned value is 99
|
156
|
+
|
157
|
+
# A refcursor is returned from a stored procedure as a SimpleOracleJDBC::SQL object, so it can
|
158
|
+
# be accessed in the way as the SQL examples above:
|
159
|
+
#
|
160
|
+
# create or replace function test_refcursor
|
161
|
+
# return sys_refcursor
|
162
|
+
# is
|
163
|
+
# v_refc sys_refcursor;
|
164
|
+
# begin
|
165
|
+
# open v_refc for
|
166
|
+
# select level rnum, 1 c1, 'abc' c2, sysdate c3, 23.56 c4
|
167
|
+
# from dual
|
168
|
+
# connect by level <= 4;
|
169
|
+
#
|
170
|
+
# return v_refc;
|
171
|
+
# end;
|
172
|
+
# /
|
173
|
+
#
|
174
|
+
proc = conn.prepare_proc("begin :return := test_refcursor; end;")
|
175
|
+
proc.execute([:refcursor, nil, :out])
|
176
|
+
sql_object = proc[1]
|
177
|
+
sql_object.each_hash do |row|
|
178
|
+
puts row
|
179
|
+
end
|
49
180
|
proc.close
|
181
|
+
|
182
|
+
# > {"RNUM"=>1.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:32:48 +0000, "C4"=>23.56}
|
183
|
+
# > {"RNUM"=>2.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:32:48 +0000, "C4"=>23.56}
|
184
|
+
# > {"RNUM"=>3.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:32:48 +0000, "C4"=>23.56}
|
185
|
+
# > {"RNUM"=>4.0, "C1"=>1.0, "C2"=>"abc", "C3"=>2013-02-12 22:32:48 +0000, "C4"=>23.56}
|
50
186
|
|
51
|
-
|
187
|
+
|
188
|
+
# Datamapping
|
52
189
|
|
53
190
|
Basic Ruby types are mapped automatically into the correct types for JDBC interaction, and the JDBC types are mapped back to Ruby types when they are retrieved from the database.
|
54
191
|
|
55
|
-
|
192
|
+
# TODO (AKA missing features)
|
56
193
|
|
57
194
|
Bindable types that are not yet supported:
|
195
|
+
|
58
196
|
* passing a ref_cursor into a proc
|
59
197
|
* binding a CLOB to a procedure
|
60
198
|
|
61
199
|
Types that cannot be retrieved from an SQL result set
|
200
|
+
|
62
201
|
* CLOB
|
63
202
|
* Cursor
|
64
203
|
* Long
|
@@ -0,0 +1,214 @@
|
|
1
|
+
module SimpleOracleJDBC
|
2
|
+
module Binding
|
3
|
+
|
4
|
+
# Provides a set of methods to map Ruby types to their JDBC equivalent and back again.
|
5
|
+
|
6
|
+
|
7
|
+
RUBY_TO_JDBC_TYPES = {
|
8
|
+
Date => OracleTypes::DATE,
|
9
|
+
Time => OracleTypes::TIMESTAMP,
|
10
|
+
String => OracleTypes::VARCHAR,
|
11
|
+
Fixnum => OracleTypes::INTEGER,
|
12
|
+
Integer => OracleTypes::INTEGER,
|
13
|
+
Bignum => OracleTypes::NUMERIC,
|
14
|
+
Float => OracleTypes::NUMERIC,
|
15
|
+
:refcursor => OracleTypes::CURSOR
|
16
|
+
}
|
17
|
+
|
18
|
+
# Given a JDBC prepared call or prepared statement, a value and a bind index, the value
|
19
|
+
# will be bound to JDBC statement.
|
20
|
+
#
|
21
|
+
# If value is a single value, ie not an array in is considered an IN parameter.
|
22
|
+
#
|
23
|
+
# If value is an array, then it should have either 2 or 3 elements.
|
24
|
+
#
|
25
|
+
# * 2 elements indictes the value is an IN parameter, element 0 indicates the type
|
26
|
+
# of the bind variable, and element 1 is the value, eg:
|
27
|
+
#
|
28
|
+
# [String, "Some_value"]
|
29
|
+
#
|
30
|
+
# * 3 elements indicates the value is an OUT or an IN OUT parameter (useful only when using
|
31
|
+
# stored procedures), eg:
|
32
|
+
#
|
33
|
+
# [String, "Some_value", :out]
|
34
|
+
# [:refcursor, nil, :out]
|
35
|
+
#
|
36
|
+
# When binding values, Ruby types are mapped to Java / JDBC types based on the type
|
37
|
+
# of the passed in Ruby object. The mapping is as follows:
|
38
|
+
#
|
39
|
+
# RUBY_TO_JDBC_TYPES = {
|
40
|
+
# Date => OracleTypes::DATE,
|
41
|
+
# Time => OracleTypes::TIMESTAMP,
|
42
|
+
# String => OracleTypes::VARCHAR,
|
43
|
+
# Fixnum => OracleTypes::INTEGER,
|
44
|
+
# Integer => OracleTypes::INTEGER,
|
45
|
+
# Bignum => OracleTypes::NUMERIC,
|
46
|
+
# Float => OracleTypes::NUMERIC,
|
47
|
+
# :refcursor => OracleTypes::CURSOR
|
48
|
+
# }
|
49
|
+
#
|
50
|
+
# Note that to bind a ref_cursor, there is no natural Ruby class, so it can only be bound using
|
51
|
+
# the array form for values.
|
52
|
+
#
|
53
|
+
# Also note that in this version, it is not possible to bind a ref_cursor into a procedure - it can
|
54
|
+
# only be retrieved.
|
55
|
+
def bind_value(obj, v, i)
|
56
|
+
type = v.class
|
57
|
+
value = v
|
58
|
+
if v.is_a? Array
|
59
|
+
# class is being overriden from the input
|
60
|
+
type = v[0]
|
61
|
+
value = v[1]
|
62
|
+
|
63
|
+
if v.length == 3
|
64
|
+
bind_out_parameter(obj, i, type)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
if type == Date
|
69
|
+
bind_date(obj, value, i)
|
70
|
+
elsif type == Time
|
71
|
+
bind_time(obj, value, i)
|
72
|
+
elsif type == String
|
73
|
+
bind_string(obj, value, i)
|
74
|
+
elsif type == Fixnum or type == Integer
|
75
|
+
bind_int(obj, value, i)
|
76
|
+
elsif type == Float
|
77
|
+
bind_number(obj, value, i)
|
78
|
+
elsif type == :refcursor
|
79
|
+
bind_refcursor(obj, value, i)
|
80
|
+
else
|
81
|
+
raise UnknownBindType, type.to_s
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Given a open JDBC result set and a column index, the value is retrieved
|
86
|
+
# and mapped into a Ruby type.
|
87
|
+
#
|
88
|
+
# The columns are indexed from 1 in the array.
|
89
|
+
#
|
90
|
+
# If the retrieved value is null, nil is returned.
|
91
|
+
def retrieve_value(obj, i)
|
92
|
+
case obj.get_meta_data.get_column_type_name(i)
|
93
|
+
when 'NUMBER'
|
94
|
+
retrieve_number(obj, i)
|
95
|
+
when 'INTEGER'
|
96
|
+
retrieve_int(obj, i)
|
97
|
+
when 'DATE'
|
98
|
+
retrieve_time(obj, i)
|
99
|
+
when 'TIMESTAMP'
|
100
|
+
retrieve_time(obj, i)
|
101
|
+
when 'CHAR', 'VARCHAR2'
|
102
|
+
retrieve_string(obj, i)
|
103
|
+
else
|
104
|
+
raise UnknownSQLType, obj.get_meta_data.get_column_type_name(i)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# :nodoc:
|
109
|
+
def bind_out_parameter(obj, index, type)
|
110
|
+
internal_type = RUBY_TO_JDBC_TYPES[type] || OracleTypes::VARCHAR
|
111
|
+
obj.register_out_parameter(index, internal_type)
|
112
|
+
end
|
113
|
+
|
114
|
+
def bind_date(obj, v, i)
|
115
|
+
if v
|
116
|
+
# %Q is micro seconds since epoch. Divide by 1000 to get milli-sec
|
117
|
+
jdbc_date = Java::JavaSql::Date.new(v.strftime("%s").to_f * 1000)
|
118
|
+
obj.set_date(i, jdbc_date)
|
119
|
+
else
|
120
|
+
obj.set_null(i, OracleTypes::DATE)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def bind_time(obj, v, i)
|
125
|
+
if v
|
126
|
+
# Need to use an Oracle TIMESTAMP - dates don't allow a time to be specified
|
127
|
+
# for some reason, even though a date in Oracle contains a time.
|
128
|
+
jdbc_time = TIMESTAMP.new(Java::JavaSql::Timestamp.new(v.to_f * 1000))
|
129
|
+
obj.setTIMESTAMP(i, jdbc_time)
|
130
|
+
else
|
131
|
+
obj.set_null(i, OracleTypes::TIMESTAMP)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def bind_string(obj, v, i)
|
136
|
+
if v
|
137
|
+
obj.set_string(i, v)
|
138
|
+
else
|
139
|
+
obj.set_null(i, OracleTypes::VARCHAR)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
def bind_int(obj, v, i)
|
144
|
+
if v
|
145
|
+
obj.set_int(i, v)
|
146
|
+
else
|
147
|
+
obj.set_null(i, OracleTypes::INTEGER)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def bind_number(obj, v, i)
|
152
|
+
if v
|
153
|
+
obj.set_number(i, Java::OracleSql::NUMBER.new(v))
|
154
|
+
else
|
155
|
+
obj.set_null(i, OracleTypes::NUMBER)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def bind_refcursor(obj, v, i)
|
160
|
+
if v
|
161
|
+
raise "not implemented"
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def retrieve_date(obj, i)
|
166
|
+
jdate = obj.get_date(i)
|
167
|
+
if jdate
|
168
|
+
rt = Time.at(jdate.date_value.get_time.to_f / 1000)
|
169
|
+
Date.new(rt.year, rt.month, rt.day)
|
170
|
+
else
|
171
|
+
nil
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def retrieve_time(obj, i)
|
176
|
+
jdate = obj.get_timestamp(i)
|
177
|
+
if jdate
|
178
|
+
Time.at(jdate.get_time.to_f / 1000)
|
179
|
+
else
|
180
|
+
nil
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
def retrieve_string(obj, i)
|
185
|
+
obj.get_string(i)
|
186
|
+
end
|
187
|
+
|
188
|
+
def retrieve_int(obj, i)
|
189
|
+
v = obj.get_int(i)
|
190
|
+
if obj.was_null
|
191
|
+
nil
|
192
|
+
else
|
193
|
+
v
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
def retrieve_number(obj, i)
|
198
|
+
v = obj.get_number(i)
|
199
|
+
if v
|
200
|
+
v.double_value
|
201
|
+
else
|
202
|
+
nil
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
def retrieve_refcursor(obj, i)
|
207
|
+
rset = obj.get_object(i)
|
208
|
+
results = Sql.new
|
209
|
+
results.result_set = rset
|
210
|
+
results
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
end
|
@@ -16,13 +16,27 @@ module SimpleOracleJDBC
|
|
16
16
|
|
17
17
|
# Takes a JDBC database connection and a procedure call and returns a
|
18
18
|
# SimpleOracleJDBC object after preparing the procedure call. The prepared
|
19
|
-
# JDBC callable statement is stored in @call
|
19
|
+
# JDBC callable statement is stored in @call.
|
20
|
+
#
|
21
|
+
# @example Preparing a procedure call
|
22
|
+
# call = DBCall.prepare(conn, "begin my_proc(:b1, :b2, :b3); end;")
|
20
23
|
def self.prepare(conn, sql)
|
21
24
|
call = new(conn, sql)
|
22
25
|
end
|
23
26
|
|
24
27
|
# Takes a JDBC database connection, a procedure call and an optional set of binds and
|
25
28
|
# returns a SimpleOracleJDBC object after preparing and executing the procedure call.
|
29
|
+
# Input bind variables can be passed as simple values. If a value must be passed as null
|
30
|
+
# it should be passed in an array with a type:
|
31
|
+
#
|
32
|
+
# [String, nil]
|
33
|
+
#
|
34
|
+
# TO mark a bind as an out or inout parameter use an array with three elements:
|
35
|
+
#
|
36
|
+
# [String, nil, :out]
|
37
|
+
#
|
38
|
+
# @example Procedure Call with several binds
|
39
|
+
# call = DBCall.execute(conn, "begin my_proc(:b1, :b2, :b3); end;", "Input 1 value", [String, nil], [Float, nil, :out])
|
26
40
|
def self.execute(conn, sql, *binds)
|
27
41
|
call = new(conn,sql)
|
28
42
|
call.execute(*binds)
|
@@ -38,6 +52,10 @@ module SimpleOracleJDBC
|
|
38
52
|
# Executes the prepared callable statement stored in @call.
|
39
53
|
#
|
40
54
|
# The passed list of bind variables are bound to the object before it is executed.
|
55
|
+
# Seen the class method Execute for a definition of how to bind nulls and in/out parameters
|
56
|
+
#
|
57
|
+
# @example Procedure Call with several binds
|
58
|
+
# call = DBCall.execute(conn, "begin my_proc(:b1, :b2, :b3); end;", "Input 1 value", [String, nil], [Float, nil, :out])
|
41
59
|
def execute(*binds)
|
42
60
|
@binds = binds
|
43
61
|
@binds.each_with_index do |b,i|
|
@@ -63,7 +81,7 @@ module SimpleOracleJDBC
|
|
63
81
|
#
|
64
82
|
# The bind variables are indexed from 1.
|
65
83
|
#
|
66
|
-
# If a refcursor is
|
84
|
+
# If a refcursor is returned, it is retrieved as a SimpleOracleJDBC::Sql object. Other
|
67
85
|
# values are returned as Ruby classes, such as Date, Time, String, Float etc.
|
68
86
|
def [](i)
|
69
87
|
if i < 1
|
metadata
CHANGED
@@ -1,61 +1,80 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simpleOracleJDBC
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Stephen O'Donnell
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description: A lightweight wrapper around the JDBC interface to make it easier to
|
15
|
-
make SQL and stored procedure calls.
|
14
|
+
description: A lightweight wrapper around the JDBC interface to make it easier to make SQL and stored procedure calls.
|
16
15
|
email: stephen@betteratoracle.com
|
17
16
|
executables: []
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files:
|
20
19
|
- README.md
|
21
20
|
files:
|
22
|
-
-
|
23
|
-
|
24
|
-
-
|
25
|
-
|
26
|
-
-
|
27
|
-
|
28
|
-
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
-
|
33
|
-
|
34
|
-
-
|
35
|
-
|
36
|
-
-
|
21
|
+
- !binary |-
|
22
|
+
dGVzdC9iaW5kaW5nX3Rlc3QucmI=
|
23
|
+
- !binary |-
|
24
|
+
dGVzdC9kYl9jYWxsX3Rlc3QucmI=
|
25
|
+
- !binary |-
|
26
|
+
dGVzdC9oZWxwZXIucmI=
|
27
|
+
- !binary |-
|
28
|
+
dGVzdC9pbnRlcmZhY2VfdGVzdC5yYg==
|
29
|
+
- !binary |-
|
30
|
+
dGVzdC9yZXN1bHRfc2V0X3Rlc3QucmI=
|
31
|
+
- !binary |-
|
32
|
+
dGVzdC9zcWxfdGVzdC5yYg==
|
33
|
+
- !binary |-
|
34
|
+
dGVzdC90ZXN0X3J1bm5lci5yYg==
|
35
|
+
- !binary |-
|
36
|
+
bGliL3NpbXBsZV9vcmFjbGVfamRiYy5yYg==
|
37
|
+
- !binary |-
|
38
|
+
bGliL3NpbXBsZV9vcmFjbGVfamRiYy8jYmluZGluZ3MucmIj
|
39
|
+
- !binary |-
|
40
|
+
bGliL3NpbXBsZV9vcmFjbGVfamRiYy9iaW5kaW5ncy5yYg==
|
41
|
+
- !binary |-
|
42
|
+
bGliL3NpbXBsZV9vcmFjbGVfamRiYy9kYl9jYWxsLnJi
|
43
|
+
- !binary |-
|
44
|
+
bGliL3NpbXBsZV9vcmFjbGVfamRiYy9pbnRlcmZhY2UucmI=
|
45
|
+
- !binary |-
|
46
|
+
bGliL3NpbXBsZV9vcmFjbGVfamRiYy9yZXN1bHRfc2V0LnJi
|
47
|
+
- !binary |-
|
48
|
+
bGliL3NpbXBsZV9vcmFjbGVfamRiYy9zcWwucmI=
|
49
|
+
- !binary |-
|
50
|
+
UmFrZWZpbGUucmI=
|
51
|
+
- !binary |-
|
52
|
+
UkVBRE1FLm1k
|
37
53
|
homepage: http://betteratoracle.com
|
38
54
|
licenses: []
|
39
|
-
post_install_message:
|
55
|
+
post_install_message:
|
40
56
|
rdoc_options: []
|
41
57
|
require_paths:
|
42
58
|
- lib
|
43
59
|
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
60
|
requirements:
|
46
61
|
- - ! '>='
|
47
62
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
49
|
-
|
63
|
+
version: !binary |-
|
64
|
+
MA==
|
50
65
|
none: false
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
67
|
requirements:
|
52
68
|
- - ! '>='
|
53
69
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
70
|
+
version: !binary |-
|
71
|
+
MA==
|
72
|
+
none: false
|
55
73
|
requirements: []
|
56
|
-
rubyforge_project:
|
57
|
-
rubygems_version: 1.8.
|
58
|
-
signing_key:
|
74
|
+
rubyforge_project:
|
75
|
+
rubygems_version: 1.8.25
|
76
|
+
signing_key:
|
59
77
|
specification_version: 3
|
60
78
|
summary: A gem to simplify JDBC database access to Oracle when using JRuby
|
61
79
|
test_files: []
|
80
|
+
has_rdoc: true
|