1 30 31 32 package org.hsqldb.util; 33 34 import java.sql.ResultSet ; 35 import java.sql.ResultSetMetaData ; 36 import java.sql.SQLException ; 37 import java.sql.Types ; 38 39 41 47 class HsqldbTransferHelper extends TransferHelper { 48 49 public HsqldbTransferHelper() { 50 super(); 51 } 52 53 public HsqldbTransferHelper(TransferDb database, Traceable t, String q) { 54 super(database, t, q); 55 } 56 57 int convertFromType(int type) { 58 59 if (type == 100) { 60 type = Types.VARCHAR; 61 62 tracer.trace("Converted HSQLDB VARCHAR_IGNORECASE to VARCHAR"); 63 } 64 65 return (type); 66 } 67 68 String fixupColumnDefRead(TransferTable t, ResultSetMetaData meta, 69 String columnType, ResultSet columnDesc, 70 int columnIndex) throws SQLException { 71 72 String CompareString = "INTEGER IDENTITY"; 73 74 if (columnType.indexOf(CompareString) >= 0) { 75 76 columnType = "SERIAL"; 78 } 79 80 return (columnType); 81 } 82 83 String fixupColumnDefWrite(TransferTable t, ResultSetMetaData meta, 84 String columnType, ResultSet columnDesc, 85 int columnIndex) throws SQLException { 86 87 if (columnType.indexOf("SERIAL") >= 0) { 88 columnType = " INTEGER IDENTITY "; 89 } 90 91 return (columnType); 92 } 93 94 String fixupColumnDefRead(String aTableName, ResultSetMetaData meta, 95 String columnType, ResultSet columnDesc, 96 int columnIndex) throws SQLException { 97 return fixupColumnDefRead((TransferTable) null, meta, columnType, 98 columnDesc, columnIndex); 99 } 100 101 String fixupColumnDefWrite(String aTableName, ResultSetMetaData meta, 102 String columnType, ResultSet columnDesc, 103 int columnIndex) throws SQLException { 104 return fixupColumnDefWrite((TransferTable) null, meta, columnType, 105 columnDesc, columnIndex); 106 } 107 108 String formatName(String t) { 109 return formatIdentifier(t); 110 } 111 } 112 | Popular Tags |