1 29 30 package com.caucho.jdbc; 31 32 import com.caucho.util.Log; 33 34 import javax.sql.DataSource ; 35 import java.util.logging.Logger ; 36 37 40 public class PostgresMetaData extends JdbcMetaData { 41 private static final Logger log = Log.open(PostgresMetaData.class); 42 43 protected PostgresMetaData(DataSource ds) 44 { 45 super(ds); 46 } 47 48 51 public boolean supportsSequences() 52 { 53 return true; 54 } 55 56 59 public String createSequenceSQL(String name, int size) 60 { 61 if (size > 1) 62 return "CREATE SEQUENCE " + name + " INCREMENT " + size; 63 else 64 return "CREATE SEQUENCE " + name; 65 } 66 67 70 public String selectSequenceSQL(String name) 71 { 72 return "SELECT Nextval('" + name + "')"; 73 } 74 75 78 public String testSequenceSQL(String name) 79 { 80 return "SELECT Currval('" + name + "')"; 81 } 82 83 86 public String generateBoolean(String term) 87 { 88 return "(" + term + " = 't')"; 89 } 90 } 91 | Popular Tags |