]> git.mxchange.org Git - jcore.git/commitdiff
Added handling of Integer and Float values
authorRoland Haeder <roland@mxchange.org>
Fri, 14 Aug 2015 12:51:33 +0000 (14:51 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 14 Aug 2015 12:51:33 +0000 (14:51 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/database/backend/mysql/MySqlDatabaseBackend.java

index 1b4af28e603014f8660cb4bef0dd648f742fd492..1cf298e3e14de5a703c8732b0c12139139146091 100644 (file)
@@ -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()));