1 10 package org.mmbase.module.database; 11 12 import java.sql.*; 13 14 import org.mmbase.util.logging.Logger; 15 import org.mmbase.util.logging.Logging; 16 17 24 public class DatabaseSupportInformix implements DatabaseSupport { 25 26 private static Logger log = Logging.getLoggerInstance(DatabaseSupportInformix.class.getName()); 27 28 public void init() { 29 } 30 31 public void initConnection(Connection con) { 32 setLockMode(con,30); 33 } 34 35 public void setLockMode(Connection con,int sec) { 36 PreparedStatement statement; 37 try { 38 if (sec>0) { 39 statement=con.prepareStatement("set lock mode to wait "+sec); 40 } else { 41 statement=con.prepareStatement("set lock mode to wait"); 42 } 43 statement.executeUpdate(); 44 statement.close(); 45 } catch (Exception e) { 46 log.error("failed to set lock mode "+e); 47 log.error(Logging.stackTrace(e)); 48 } 49 } 50 } 51 | Popular Tags |