1 package org.apache.torque.adapter; 2 3 21 22 import java.sql.Connection ; 23 import java.sql.SQLException ; 24 import java.sql.Statement ; 25 26 33 public class DBDerby extends AbstractDBAdapter 34 { 35 38 private static final long serialVersionUID = 6265962681516206415L; 39 40 43 protected DBDerby() 44 { 45 } 46 47 53 public String toUpperCase(String str) 54 { 55 return new StringBuffer ("UPPER(") 56 .append(str) 57 .append(")") 58 .toString(); 59 } 60 61 67 public String ignoreCase(String str) 68 { 69 return toUpperCase(str); 70 } 71 72 75 public String getIDMethodType() 76 { 77 return AUTO_INCREMENT; 78 } 79 80 87 public String getIDMethodSQL(Object obj) 88 { 89 return "VALUES IDENTITY_VAL_LOCAL()"; 90 } 91 92 99 public void lockTable(Connection con, String table) 100 throws SQLException 101 { 102 Statement statement = con.createStatement(); 103 StringBuffer stmt = new StringBuffer (); 104 stmt.append("LOCK TABLE ") 105 .append(table).append(" IN EXCLUSIVE MODE"); 106 statement.executeUpdate(stmt.toString()); 107 } 108 109 116 public void unlockTable(Connection con, String table) 117 throws SQLException 118 { 119 } 120 121 132 133 public boolean escapeText() 134 { 135 return false; 136 } 137 138 147 public boolean useEscapeClauseForLike() 148 { 149 return true; 150 } 151 } 152 | Popular Tags |