String sql = "SELECT * FROM dbVersions WHERE name = ?";
if (LogConfiguration.loggingIsEnabled())
{
logger.log(Level.FINE, "Running SQL ["+sql+"]");
}
final JsArrayMixed args = JsArrayMixed.createArray().cast();
args.push(name);
tx.executeSQL(sql, args, new SQLTransaction.SQLStatementCallback()
{
@Override
public void onSuccess(SQLTransaction tx, SQLResultSet rs)
{
if (rs.getRows().length() > 0)
{
JsArrayMixed output = JsArrayMixed.createArray().cast();
JsUtils.readPropertyValue(rs.getRows().itemObject(0), "version", output);
doOpenDB((int) output.getNumber(0), callback, errorCallback);
}
else
{
String sql = "INSERT INTO dbVersions VALUES (?,?)";
if (LogConfiguration.loggingIsEnabled())