Top "Prepared-statement" questions

A Prepared Statement (or parameterized statement) is a precompiled SQL statement that serves to improve performance and mitigate SQL injection attacks.

Mysqli Prepare Statement - Returning False, but Why?

I have a function that generates a prepared INSERT statement based on an associative array of column names and values …

php mysqli prepared-statement
PHP PDO::bindParam() data types.. how does it work?

I'm wondering what the declaration of the data type in bindParam() (or bindValue()) is used for... I mean, I thought …

php types pdo prepared-statement
Does closing Connection automatically close statement and resultset?

I know the safe pattern in Java is to close your ResultSet, Statement, and Connection in order in a finally …

java database database-connection prepared-statement
A prepared statement, `WHERE .. IN(..)` query and sorting — with MySQL

Imagine we have a query: SELECT * FROM somewhere WHERE `id` IN(1,5,18,25) ORDER BY `name`; and an array of IDs to …

php mysql mysqli prepared-statement mergesort
How can I print the SQL query executed after Perl's DBI fills in the placeholders?

I'm using Perl's DBI module. I prepare a statement using placeholders, then execute the query. Is it possible to print …

mysql sql perl prepared-statement dbi
In SQLite, do prepared statements really improve performance?

I have heard that prepared statements with SQLite should improve performance. I wrote some code to test that, and did …

performance sqlite prepared-statement
What exactly does first parameter in bind_param() do?

I am trying to understand prepared statements using PHP and mysqli. I tried to read on some tutorials, manual and …

php mysql mysqli prepared-statement bindparam
SQL PreparedStatement & autocommit

If I create a preparedstatement using a JDBC connection which has "autocommit off", do I need to call commit() to …

jdbc prepared-statement autocommit
How do I set a full date & time sql using java, and not just the date?

I am trying to set a timestamp in my database using java, however in my table all I get is …

java mysql datetime jdbc prepared-statement
Inserting date in a database using PreparedStatement in Java

I have a form which captures a date that the user input in a JFormattedTextField. Then the Date need to …

java prepared-statement java.util.date