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
Trusted Contributor
Posts: 141
Registered: ‎02-15-2012
My Device: 9800
My Carrier: Airtel

Database delete query error

Hi,

    I am using following query for deletion of a row from database:

 

Statement st = sqliteDB.createStatement("DELETE FROM "+tablename + " WHERE " + idField+" = " + id);
st.prepare();
st.execute();
st.close();

 

It is giving nullpointer exception after st.prepare();

Please give me a solution to resolve it.

 

Thanks & Regards,

Ankit

BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Database delete query error

Verify that tablename, idField and id are not null.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker