25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/DrbDB/MyMultiSQL/jdbc.rb', line 25
def query(sql)
return nil if sql.nil? or sql.length ==0
begin
stmt = @conn.createStatement
res = stmt.executeQuery(sql)
rescue SQLException => err
eerror("#{err} in\n#{sql}")
raise "#{err}\n#{sql}\n"
rescue CommunicationsException => e
edebug("comm error")
eerror("#{e} in\n#{sql}")
raise "#{e}\n#{sql}\n"
rescue =>e
edebug("other error: #{e.class.name}")
eerror("#{err} in\n#{sql}")
end
return res
end
|