migratedb.v1.commandline.driversupport.SQLiteDriverSupport Maven / Gradle / Ivy
package migratedb.v1.commandline.driversupport;
import com.google.auto.service.AutoService;
import migratedb.v1.commandline.DriverSupport;
@AutoService(DriverSupport.class)
public class SQLiteDriverSupport implements DriverSupport {
@Override
public String getName() {
return "SQLite";
}
@Override
public boolean handlesJdbcUrl(String url) {
return url.startsWith("jdbc:sqlite:") || url.startsWith("jdbc:sqldroid:") ||
url.startsWith("jdbc:p6spy:sqlite:") || url.startsWith("jdbc:p6spy:sqldroid:");
}
@Override
public String getDriverClass(String url, ClassLoader classLoader) {
if (url.startsWith("jdbc:p6spy:sqlite:") || url.startsWith("jdbc:p6spy:sqldroid:")) {
return "com.p6spy.engine.spy.P6SpyDriver";
}
if (url.startsWith("jdbc:sqldroid:")) {
return "org.sqldroid.SQLDroidDriver";
}
return "org.sqlite.JDBC";
}
}