lib/jvertica.rb in jvertica-0.1.1 vs lib/jvertica.rb in jvertica-0.1.2

- old
+ new

@@ -37,22 +37,27 @@ prop.put key.to_s, value end @connection = begin DriverManager.getConnection "jdbc:vertica://#{host}:#{port}/#{database}", prop + @closed = false rescue => e raise ConnectionError.new("Connection Failed.\n" + "Error Message => #{e.message}\n" + "see documentation => #{Constant::CONNECTION_PROPERTY_DOCUMENT_URL}\n") end end + def closed? + @closed + end + def close - @connection.close + @connection.close && @closed = true end def commit - @connection.commit + @connection.commit end def rollback @connection.rollback end