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 34 public class DBSapDB extends AbstractDBAdapter 35 { 36 39 private static final long serialVersionUID = 8277068258155186370L; 40 41 44 protected DBSapDB() 45 { 46 } 47 48 54 public String toUpperCase(String in) 55 { 56 return new StringBuffer ("UPPER(").append(in).append(")").toString(); 57 } 58 59 65 public String ignoreCase(String in) 66 { 67 return new StringBuffer ("UPPER(").append(in).append(")").toString(); 68 } 69 70 73 public String getIDMethodType() 74 { 75 return SEQUENCE; 76 } 77 78 91 public String getIDMethodSQL(Object sequenceName) 92 { 93 return ("select " + sequenceName + ".nextval from dual"); 94 } 95 96 103 public void lockTable(Connection con, String table) throws SQLException 104 { 105 Statement statement = con.createStatement(); 106 107 StringBuffer stmt = new StringBuffer (); 108 stmt.append("SELECT next_id FROM ") 109 .append(table) 110 .append(" FOR UPDATE"); 111 112 statement.executeQuery(stmt.toString()); 113 } 114 115 122 123 public boolean escapeText() 124 { 125 return false; 126 } 127 128 136 public void unlockTable(Connection con, String table) throws SQLException 137 { 138 con.commit(); 141 } 142 } 143 | Popular Tags |