*/
public static DatabaseConnection getDatabaseConnection(Connection connection) {
DatabaseConnection databaseConnection = null;
try {
databaseConnection= new DatabaseConnection(connection);
DatabaseConfig config = databaseConnection.getConfig();
//数据库为mysql
if ("MySQL".equalsIgnoreCase(connection.getMetaData()
.getDatabaseProductName())) {
config.setProperty(DatabaseConfig.PROPERTY_METADATA_HANDLER,
new MySqlMetadataHandler());
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY,
new MySqlDataTypeFactory());
} //else if ("Oracle".equalsIgnoreCase(connection.getMetaData()
// .getDatabaseProductName())) {
// config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY,
// new Oracle10DataTypeFactory());