Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Contributor
Posts: 43
Registered: ‎07-22-2012
My Device: curve
My Carrier: syudent
Accepted Solution

Problem in sqlite statement

public static final String DATABASE_TABLE_SIZE = "SizesLookup";
public static final String KEY_SIZE_ID = "SizeId";
public static final String KEY_SIZE_Name = "SizeName";

Statement st = null;
try {
st = db.createStatement("INSERT INTO" + DATABASE_TABLE_SIZE + "("
+ KEY_SIZE_ID + "," + KEY_SIZE_Name + ") VALUES (?,?)");
st.prepare();
st.bind(1, id);
st.bind(2, name);
st.execute();
st.reset();
return true;
} catch (Exception e) {
return false;
} finally {
try {
st.close();
} catch (Exception e) {
return false;
}
}

 the code enter to exception in insert statement i want to make var to table name and columns why this error please help me

Contributor
Posts: 43
Registered: ‎07-22-2012
My Device: curve
My Carrier: syudent

Re: Problem in sqlite statement

i know the solution
insert statement will be
st = db.createStatement("INSERT INTO[" + DATABASE_TABLE_SIZE + "](["
+ KEY_SIZE_ID + "],[" + KEY_SIZE_Name + "]) VALUES (?,?)");