#AdditionalJar: sqlite-jdbc-3.7.2
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Log("Hello world!!!")
Dim sql As SQL
File.Delete(File.DirApp, "1.db")
sql.InitializeSQLite(File.DirApp, "1.db", True)
sql.ExecNonQuery("CREATE TABLE table1 (col1 INTEGER PRIMARY KEY AUTOINCREMENT , col2 TEXT)")
sql.ExecNonQuery2("INSERT INTO table1 (col2) VALUES (?)", Array("test"))
sql.ExecNonQuery2("INSERT INTO table1 (col2) VALUES (?)", Array("test"))
sql.ExecNonQuery2("INSERT INTO table1 (col2) VALUES (?)", Array("test"))
sql.ExecNonQuery2("INSERT INTO table1 (col1, col2) VALUES (?, ?)", Array(100, "test"))
sql.ExecNonQuery2("INSERT INTO table1 (col2) VALUES (?)", Array("test"))
Log(sql.ExecQuerySingleResult("SELECT last_insert_rowid()")) '101
sql.ExecNonQuery("DELETE FROM table1 WHERE col1 = 2")
sql.ExecNonQuery2("INSERT INTO table1 (col1, col2) VALUES (?, ?)", Array(2, "test"))
Log(sql.ExecQuerySingleResult("SELECT last_insert_rowid()")) '2
sql.ExecNonQuery2("INSERT INTO table1 (col2) VALUES (?)", Array("test"))
Log(sql.ExecQuerySingleResult("SELECT last_insert_rowid()")) '102
End Sub