From cc09cb7d513fe1afae58bb8542d137e046e03e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=A0=EC=9A=B0?= Date: Fri, 7 Feb 2025 11:35:54 +0900 Subject: [PATCH] Add bindInt --- .../tursodatabase/core/LimboStatement.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bindings/java/src/main/java/org/github/tursodatabase/core/LimboStatement.java b/bindings/java/src/main/java/org/github/tursodatabase/core/LimboStatement.java index bb3bb47e0..0fdf243e0 100644 --- a/bindings/java/src/main/java/org/github/tursodatabase/core/LimboStatement.java +++ b/bindings/java/src/main/java/org/github/tursodatabase/core/LimboStatement.java @@ -123,6 +123,22 @@ public class LimboStatement { private native int bindNull(long statementPointer, int position) throws SQLException; + /** + * Binds an integer value to the prepared statement at the specified position. This function calls + * bindLong because Limbo treats all integers as long (as well as SQLite). + * + *

According to SQLite documentation, the value is a signed integer, stored in 0, 1, 2, 3, 4, + * 6, or 8 bytes depending on the magnitude of the value. + * + * @param position The index of the SQL parameter to be set. + * @param value The integer value to bind to the parameter. + * @return A result code indicating the success or failure of the operation. + * @throws SQLException If a database access error occurs. + */ + public int bindInt(int position, int value) throws SQLException { + return bindLong(position, value); + } + /** * Binds a long value to the prepared statement at the specified position. *