本文整理匯總了Java中java.sql.DatabaseMetaData.getIdentifierQuoteString方法的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseMetaData.getIdentifierQuoteString方法的具體用法?Java DatabaseMetaData.getIdentifierQuoteString怎麽用?Java DatabaseMetaData.getIdentifierQuoteString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.sql.DatabaseMetaData
的用法示例。
在下文中一共展示了DatabaseMetaData.getIdentifierQuoteString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildTypeMap
import java.sql.DatabaseMetaData; //導入方法依賴的package包/類
private void buildTypeMap(Connection con) throws SQLException {
DatabaseMetaData dbMetaData = con.getMetaData();
this.identifierQuote = dbMetaData.getIdentifierQuoteString();
LogService.getRoot().log(Level.FINE, "com.rapidminer.tools.jdbc.StatementCreator.initialization_of_quote_character", this.identifierQuote);
HashMap dataTypeToMDMap = new HashMap();
ResultSet typesResult = null;
try {
typesResult = dbMetaData.getTypeInfo();
while(typesResult.next()) {
if(!dbMetaData.getDatabaseProductName().contains("PostgreSQL") || !typesResult.getString("TYPE_NAME").equals("name")) {
DataTypeSyntaxInformation dtmd = new DataTypeSyntaxInformation(typesResult, dbMetaData.getDatabaseProductName());
if(!dataTypeToMDMap.containsKey(Integer.valueOf(dtmd.getDataType())) || this.isUCanAccessVarchar(dbMetaData, dataTypeToMDMap, dtmd)) {
dataTypeToMDMap.put(Integer.valueOf(dtmd.getDataType()), dtmd);
}
}
}
} finally {
if(typesResult != null) {
typesResult.close();
}
}
this.registerSyntaxInfo(1, dataTypeToMDMap, new int[]{12});
this.registerSyntaxInfo(5, dataTypeToMDMap, new int[]{2005, 2004, -1, -16, 12});
this.registerSyntaxInfo(4, dataTypeToMDMap, new int[]{8, 7, 6});
this.registerSyntaxInfo(2, dataTypeToMDMap, new int[]{8, 7, 6});
this.registerSyntaxInfo(3, dataTypeToMDMap, new int[]{4});
this.registerSyntaxInfo(10, dataTypeToMDMap, new int[]{91, 93});
this.registerSyntaxInfo(9, dataTypeToMDMap, new int[]{93});
this.registerSyntaxInfo(11, dataTypeToMDMap, new int[]{92, 93});
this.registerSyntaxInfo(0, dataTypeToMDMap, new int[]{8, 7, 6});
this.registerSyntaxInfo(6, dataTypeToMDMap, new int[]{12});
}
示例2: initQuoteString
import java.sql.DatabaseMetaData; //導入方法依賴的package包/類
private void initQuoteString() throws Exception {
DatabaseMetaData md = getConnection().getMetaData();
quoteString = md.getIdentifierQuoteString();
}