다시 만들 수없는 안드로이드 마켓에서 오류가보고되었습니다. 오류는안드로이드 SQLite 오류 다시 작성할 수 없습니다
Caused by: android.database.sqlite.SQLiteException: near ".": syntax error: , while compiling: SELECT _id, Song, Number FROM HOLA.
at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80)
at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:46)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1454)
at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1338)
at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1293)
at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1373)
at com.example.program.DBase.fetchData(DBase.java:89)
at com.example.program.View.fillData(View.java:57)
at com.example.program.View.onCreate(View.java:29)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more
입니다. HOLA는 사용자가 입력 한 테이블입니다. 내가 사용하는 코드는
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getLoc();
setContentView(R.layout.notepad_list);
db = new DBase(this);
db.open();
fillData();
db.close();
}
및
private void fillData() {
// Get all of the notes from the database and create the item list
Cursor c = db.fetchData(loc);
startManagingCursor(c);
String[] from = new String[] { DBase.KEY_ONE, DBase.KEY_TWO };
int[] to = new int[] { R.id.text1, R.id.text2 };
// Now create an array adapter and set it to display using our row
SimpleCursorAdapter notes = new SimpleCursorAdapter(this,
R.layout.notes_row, c, from, to);
setListAdapter(notes);
}
그리고 마지막으로
public Cursor fetchData(String loc) {
// TODO Auto-generated method stub
return ourDatabase.query(loc, new String[] { KEY_ROWID, KEY_ONE, KEY_TWO },
null, null, null, null, null);
}
LOC는 현재 테이블에 변수 포인팅입니다. 이것이 일어나는 이유는 무엇입니까? 나는을 포함하여 자료를 입력하는 것을 시도했다. 및 오류에서 언급 한,하지만 난 FC를 얻을 수 없었다. 내 테이블 추가 코드
public long addTable(String loc) {
// TODO Auto-generated method stub
ourDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + loc + " ("
+ KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_2TBL
+ " TEXT NOT NULL, " + KEY_TWO + " TEXT NOT NULL, "
+ KEY_ONE + " TEXT NOT NULL);");
ContentValues cv = new ContentValues();
cv.put(KEY_2TBL, loc);
return ourDatabase.insert(loc, null, cv);
}
외국어로 약 40 %의 다운로드가 있음을 발견했습니다. 테이블 이름 HOLA에서 사용자가 스페인어를 사용하고있는 것 같습니다. 내 앱이 현지화되지 않았습니다. 그게 문제가 될 수 있을까요? –