List of usage examples for java.sql Connection getWarnings
SQLWarning getWarnings() throws SQLException;
Connection
object. From source file:rems.Global.java
public static void executeGnrlSQL(String genSql) { Statement stmt = null;/*from w ww. j a va 2 s . co m*/ try { Connection mycon = null; Class.forName("org.postgresql.Driver"); mycon = DriverManager.getConnection(Global.connStr, Global.Uname, Global.Pswd); mycon.setAutoCommit(false); //System.out.println("Opened database successfully"); stmt = mycon.createStatement(); stmt.executeUpdate(genSql); mycon.commit(); Global.updateLogMsg(Global.logMsgID, "\r\n" + stmt.getWarnings().toString() + ": " + mycon.getWarnings().toString() + "\r\n", Global.logTbl, Global.gnrlDateStr, Global.rnUser_ID); stmt.close(); mycon.close(); } catch (Exception ex) { Global.errorLog = genSql + "\r\n" + ex.getMessage(); Global.writeToLog(); } finally { } }