Code example for SQLiteDatabase

Methods: beginTransactionendTransactionexecSQLsetTransactionSuccessful

0
	} 
 
	/** * �f�[�^�x�[�X�̐����ɌĂяo�������̂ŁA �X�L�[�}�̐������s�� */ 
	@Override 
	public void onCreate(SQLiteDatabase db) {
		db.beginTransaction();
		try { 
			// �e�[�u���̐��� 
			StringBuilder createSql = new StringBuilder();
			createSql.append("create table " + TABLE_NAME + " (");
			createSql.append(COLUMN_ID + " integer primary key,");
			 
			createSql.append(COLUMN_IP_1 + " integer not null,");
			createSql.append(COLUMN_IP_2 + " integer not null,");
			createSql.append(COLUMN_IP_3 + " integer not null,");
			createSql.append(COLUMN_IP_4 + " integer not null,");
			createSql.append(COLUMN_HOP_COUNT + " integer not null,");
			createSql.append(COLUMN_LifeTime + " integer not null,");
			createSql.append(COLUMN_CAN_USE + " text not null");
			createSql.append(")");
			 
			db.execSQL(createSql.toString());
			db.setTransactionSuccessful();
		} finally { 
			db.endTransaction();
		} 
	} 
	 
	 
	// �f�[�^�x�[�X�̍X�V