|
7 | 7 | import java.io.Reader; |
8 | 8 | import java.math.BigDecimal; |
9 | 9 | import java.net.URL; |
10 | | -import java.nio.charset.StandardCharsets; |
11 | 10 | import java.sql.*; |
12 | | -import java.time.LocalDateTime; |
13 | 11 | import java.time.ZoneId; |
14 | 12 | import java.time.format.DateTimeFormatter; |
15 | 13 | import java.time.format.DateTimeFormatterBuilder; |
16 | 14 | import java.time.temporal.ChronoField; |
17 | | -import java.time.temporal.TemporalField; |
18 | 15 | import java.util.Calendar; |
19 | 16 | import java.util.GregorianCalendar; |
20 | 17 |
|
@@ -78,13 +75,13 @@ public void setNull(int parameterIndex, int sqlType) throws SQLException { |
78 | 75 | @Override |
79 | 76 | public void setBoolean(int parameterIndex, boolean x) throws SQLException { |
80 | 77 | checkClosed(); |
81 | | - parameters[parameterIndex - 1] = x; |
| 78 | + parameters[parameterIndex - 1] = Boolean.toString(x); |
82 | 79 | } |
83 | 80 |
|
84 | 81 | @Override |
85 | 82 | public void setByte(int parameterIndex, byte x) throws SQLException { |
86 | 83 | checkClosed(); |
87 | | - parameters[parameterIndex - 1] = x; |
| 84 | + parameters[parameterIndex - 1] = Byte.toString(x); |
88 | 85 | } |
89 | 86 |
|
90 | 87 | @Override |
@@ -132,7 +129,7 @@ public void setString(int parameterIndex, String x) throws SQLException { |
132 | 129 | @Override |
133 | 130 | public void setBytes(int parameterIndex, byte[] x) throws SQLException { |
134 | 131 | checkClosed(); |
135 | | - parameters[parameterIndex - 1] = new String(x, StandardCharsets.UTF_8); |
| 132 | + throw new SQLFeatureNotSupportedException("Bytes is not yet supported."); |
136 | 133 | } |
137 | 134 |
|
138 | 135 | @Override |
@@ -265,7 +262,6 @@ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLExceptio |
265 | 262 | ZoneId tz = cal.getTimeZone().toZoneId(); |
266 | 263 | Calendar c = (Calendar) cal.clone(); |
267 | 264 | c.setTime(x); |
268 | | - System.out.println(String.format("'%s'", TIME_FORMATTER.format(c.toInstant().atZone(tz).toLocalTime()))); |
269 | 265 | parameters[parameterIndex - 1] = String.format("'%s'", TIME_FORMATTER.format(c.toInstant().atZone(tz).toLocalTime())); |
270 | 266 | } |
271 | 267 |
|
|
0 commit comments