| Module | Sequel::JDBC::Postgres::AdapterMethods |
| In: |
lib/sequel/adapters/jdbc/postgresql.rb
|
Methods to add to the JDBC adapter/connection to allow it to work with the shared PostgreSQL code.
Give the JDBC adapter a direct execute method, which creates a statement with the given sql and executes it.
# File lib/sequel/adapters/jdbc/postgresql.rb, line 17
17: def execute(sql, args=nil)
18: method = block_given? ? :executeQuery : :execute
19: stmt = createStatement
20: begin
21: rows = stmt.send(method, sql)
22: yield(rows) if block_given?
23: rescue NativeException => e
24: raise_error(e)
25: ensure
26: stmt.close
27: end
28: end