Hy
here is the matching Code-Sniplet from PlatformUtils:
--- cut ---
/**
* Tries to determine the database type for the given data source.
Note that this will establish
* a connection to the database.
*
* @param dataSource The data source
* @return The database type or <code>null</code> if the database
type couldn't be determined
*/
public String determineDatabaseType(DataSource dataSource) throws
DynaSqlException
{
Connection connection = null;
try
{
connection = dataSource.getConnection();
DatabaseMetaData metaData = connection.getMetaData();
return determineDatabaseType(metaData.getDriverName(),
metaData.getURL());
}
catch (SQLException ex)
{
throw new DynaSqlException("Error while reading the database
metadata", ex);
}
finally
{
if (connection != null)
{
try
{
connection.close();
}
catch (SQLException ex)
{
// we ignore this one
}
}
}
}
--- cut ---
Robert Einsle schrieb:
Hy,
an aditional Question. When i retrive the Platform (Platform platform
= PlatformFactory.createNewPlatformInstance(<Datasource));) DdlUtils
closes the java.sql.Connection inside the Datasource. Is it possible
to let DdlUtils not close the Conenction?
So i have to create an Connection, let create the Platform, the create
the Connection again.
Thanks for Help.
\Robert
\Robert