Good day to everyone, for the first time decided to use Sqlite and in general a database. When I first added 100 records, I almost fell off the chair, waited 20 seconds. Then I read about transactions, everything now takes 6 seconds. But this is not enough for me, I also read about the use of the prepared statement, but how it works and how I used it in java only under android. Show an example with comments on the use of the prepared application for the PC, please.

  • The first link is from Google , the second link is from Google , it’s not clear what you were looking for, but there’s nothing about the androyd. The principle is always the same in any language, database and driver. write the request with placeholders, prepare the request, then in a loop, substitute the data and execute the prepared request. In general, for insertion, you can use a construction with multiple values : insert into ... values (1, 'xxx'), (2, 'yyy') .... - teran
  • In addition to speed, prepared queries increase security, because parameter values ​​are transferred separately from the request body, excluding sql injections. - teran

0