1 29 30 package com.caucho.jdbc; 31 32 import com.caucho.util.Log; 33 34 import javax.sql.DataSource ; 35 import java.sql.Types ; 36 import java.util.logging.Logger ; 37 38 41 public class OracleMetaData extends JdbcMetaData { 42 private static final Logger log = Log.open(OracleMetaData.class); 43 44 protected OracleMetaData(DataSource ds) 45 { 46 super(ds); 47 } 48 49 52 public boolean isTruncateBlobBeforeDelete() 53 { 54 return true; 55 } 56 57 60 public String getCreateColumnSQL(int sqlType, int length, int precision, int scale) 61 { 62 switch (sqlType) { 64 case Types.DATE: 65 case Types.TIME: 66 return "DATE"; 67 case Types.DOUBLE: 68 return "DOUBLE PRECISION"; 69 } 70 71 return super.getCreateColumnSQL(sqlType, length, precision, scale); 72 } 73 74 77 public boolean supportsSequences() 78 { 79 return true; 80 } 81 82 85 public String createSequenceSQL(String name, int size) 86 { 87 if (size > 1) 88 return "CREATE SEQUENCE " + name + " INCREMENT BY " + size; 89 else 90 return "CREATE SEQUENCE " + name; 91 } 92 93 96 public String selectSequenceSQL(String name) 97 { 98 return "SELECT " + name + ".nextval FROM DUAL"; 99 } 100 } 101 | Popular Tags |