Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert data in codename one db using prepared statement?

I am trying to use to insert into the table but got the exception that array index out of bounds ?

Please give me the idea how to do that and where is I am making mistake? I have tried many conversion but doesn't get succeeded.

Following is the code

 Object[]param={ID,name,Fathername,Address,Mob,Gender,Qualification};


 try{
 db=Display.getInstance().openOrCreate("students.db");

 db.execute("insert into clStudent values('?','?','?',?,'?','?','?')", (Object[]) param) ;

1 Answers

You should drop the single quotes around the question marks in your query string.

like image 130
Yngve Moe Avatar answered Nov 21 '25 23:11

Yngve Moe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!