From: Roland Haeder Date: Fri, 14 Aug 2015 12:51:33 +0000 (+0200) Subject: Added handling of Integer and Float values X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2639398995e57f980ae88c1c872beac4b3b6d9e3;p=jcore.git Added handling of Integer and Float values Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/jcore/database/backend/mysql/MySqlDatabaseBackend.java b/src/org/mxchange/jcore/database/backend/mysql/MySqlDatabaseBackend.java index 1b4af28..1cf298e 100644 --- a/src/org/mxchange/jcore/database/backend/mysql/MySqlDatabaseBackend.java +++ b/src/org/mxchange/jcore/database/backend/mysql/MySqlDatabaseBackend.java @@ -351,6 +351,18 @@ public class MySqlDatabaseBackend extends BaseDatabaseBackend implements Databas // Found string statement.setString(index, (String) value); + } else if (value instanceof Integer) { + // Debug message + this.getLogger().debug(MessageFormat.format("Setting integer value={0} for index={1}", value, index)); + + // Found ineteger + statement.setInt(index, (int) value); + } else if (value instanceof Float) { + // Debug message + this.getLogger().debug(MessageFormat.format("Setting float value={0} for index={1}", value, index)); + + // Found ineteger + statement.setFloat(index, (float) value); } else { // Not parseable type throw new SQLException(MessageFormat.format("Cannot handle value={0} for index={1} in table {2}", value, index, this.getTableName()));