i want to write this line in an sqlight db b:
CREATE TABLE "android_metadata" ("locale" TEXT DEFAULT 'en_US')
therefore in my java file who generate this data base i am doing :
stat.executeUpdate("create table "+"android_metadata"+"("+"locale"+ " TEXT DEAFULT"+");");
PreparedStatement prep1 = conn.prepareStatement(
"insert into "+"android_metadata"+" values (?);");
prep1.setString(1, "en_US") ;
but the output is not similer how do i make the sqlight locale be "locale" with "" in the declaration and the field locale would be just TEXT
as similer to this blog start : http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
thanX
To escape the double quotes use a backslash:
stat.executeUpdate("create table \"android_metadata\" (\"locale\" TEXT DEFAULT 'en_US');");
Also I think you don't need double quotes round android_metadata as it is not an SQL keyword.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With