Code example for SQLiteDatabase

Methods: compileStatementexecSQL

0
		String sql = "SELECT in1,in2,ideal1 FROM xor ORDER BY rowid";
		String dbName = "encog-test.db";
		AndroidSqliteCODEC androidCodec = new AndroidSqliteCODEC(this.getContext(), dbName, sql, 2, 1);
		SQLiteDatabase db = androidCodec.getDatabase();
		 
		db.execSQL("delete from xor");
		 
		SQLiteStatement insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(0,0,0)");
		insertStmt.executeInsert();
		insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(1,0,1)");
		insertStmt.executeInsert();
		insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(0,1,1)");
		insertStmt.executeInsert();
		insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(1,1,0)");
		insertStmt.executeInsert();
		 
		CodecMLDataSet data = new CodecMLDataSet(androidCodec);
		 
		XOR.testXORDataSet((MLDataSet)data);