* @param driver
* @return
*/
private AdapterBase selectAdapter(String driver)
{
AdapterBase res = null;
if (driver.startsWith("jdbc:mysql:"))
{
res = new MySqlAdapter(this);
}
else if (driver.startsWith("jdbc:postgresql:"))
{
res = new PostgreSqlAdapter(this);
}
else if (driver.startsWith("jdbc:derby:"))
{
res = new DerbyAdapter(this);
}
else if (driver.startsWith("jdbc:hsqldb:"))
{
res = new HsqldbAdapter(this);
}
else if (driver.startsWith("jdbc:firebirdsql:"))
{
res = new FirebirdAdapter(this);
}
else if (driver.startsWith("jdbc:sqlite:"))
{
res = new SqLiteAdapter(this);
}
else if (driver.startsWith("jdbc:monetdb"))
{
res = new MonetDbAdapter(this);
}
// TODO: If you want to extend Conserve to handle a new RDBMS,
// add the case here and return a custom subclass of AdapterBase.
else
{
// use the default (H2) adapter.
res = new AdapterBase(this);
}
return res;
}