Skip to content

jdbc: DATE/TIME format roundtrip fails #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ztarvos opened this issue Sep 5, 2018 · 1 comment
Closed

jdbc: DATE/TIME format roundtrip fails #44

ztarvos opened this issue Sep 5, 2018 · 1 comment
Labels
bug Something isn't working jdbc
Milestone

Comments

@ztarvos
Copy link

ztarvos commented Sep 5, 2018

DATE, TIME types cannot be retrieved as java.sql.Data, java.sql.Time correspondingly when inserted into appropriate DATE and TIME columns as strings ‘yyyy-mm-dd’ and ‘HH:MM:SS’.

The response contains strings whereas driver expects longs.

CREATE TABLE testdt(id INT PRIMARY KEY, d DATE)
INSERT INTO testdt(id, d) VALUES (1, '1983-03-14')

Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT d FROM testdt");
rs.next();
rs.getDate(1) - fails

Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number at org.tarantool.jdbc.SQLResultSet.getNumber(SQLResultSet.java:106) at org.tarantool.jdbc.SQLResultSet.getLong(SQLResultSet.java:112) at org.tarantool.jdbc.SQLResultSet.getDate(SQLResultSet.java:138) at TestJdbcDateTime.main(TestJdbcDateTime.java:29)

@Totktonada Totktonada added the jdbc label Nov 1, 2018
@Totktonada Totktonada added this to the JDBC MVP milestone Nov 1, 2018
@Totktonada Totktonada added the bug Something isn't working label Nov 1, 2018
@Totktonada
Copy link
Member

Covered by #91.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jdbc
Projects
None yet
Development

No branches or pull requests

2 participants