dbd-jdbc 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/dbd/Jdbc.rb +20 -1
  3. metadata +2 -2
data/Rakefile CHANGED
@@ -28,7 +28,7 @@ Rake::Task['manifest'].invoke # Always regen manifest, so Hoe has up-to-date lis
28
28
 
29
29
  begin
30
30
  require 'hoe'
31
- Hoe.new("dbd-jdbc", "0.0.3") do |p|
31
+ Hoe.new("dbd-jdbc", "0.0.4") do |p|
32
32
  p.rubyforge_name = "jruby-extras"
33
33
  p.url = "http://kenai.com/projects/dbd-jdbc"
34
34
  p.author = "Chad Johnson"
@@ -36,7 +36,7 @@ module DBI
36
36
  include_class 'java.sql.Connection'
37
37
  include_class 'java.sql.ResultSet'
38
38
 
39
- VERSION = "0.0.3"
39
+ VERSION = "0.0.4"
40
40
 
41
41
  module Type
42
42
  class Timestamp < DBI::Type::Null
@@ -142,6 +142,25 @@ module DBI
142
142
  raise DBI::DatabaseError.new(error.message)
143
143
  end
144
144
 
145
+ def do(statement, *bindvars)
146
+ res = nil
147
+ if bindvars.nil? || bindvars.empty?
148
+ stmt = @connection.createStatement()
149
+ begin
150
+ stmt.execute(statement)
151
+ ensure
152
+ stmt.close rescue NativeException
153
+ end
154
+ else
155
+ stmt = execute(statement, *bindvars)
156
+ res = stmt.rows
157
+ stmt.finish
158
+ end
159
+ return res
160
+ rescue NativeException => error
161
+ raise DBI::DatabaseError.new(error.message)
162
+ end
163
+
145
164
  def ping
146
165
  return !@connection.isClosed
147
166
  rescue NativeException => error
metadata CHANGED
@@ -43,12 +43,12 @@ requirements: []
43
43
 
44
44
  authors:
45
45
  - Chad Johnson
46
- date: 2009-03-10 00:00:00 Z
46
+ date: 2009-03-11 00:00:00 Z
47
47
  platform: ruby
48
48
  test_files: []
49
49
 
50
50
  version: !ruby/object:Gem::Version
51
- version: 0.0.3
51
+ version: 0.0.4
52
52
  require_paths:
53
53
  - lib
54
54
  dependencies: []