We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This works fine with Oracle DB but does not work with MySQL DB. After setting time with setObject(), I get back time of 00:00:00
What I Did Java codes: Statement st = dbConn.createStatement(); PreparedStatement pst = dbConn.prepareStatement( "insert into jdbc_occ_test (id, int_val, str_val, char_val, float_val, raw_val, blob_val, clob_val, date_val, "
ResultSet rs = st.executeQuery( "select id, int_val, str_val, char_val, float_val, raw_val, blob_val, " + "clob_val, date_val, time_val, timestamp_val from jdbc_occ_test where id=" + iID_START); rs.next(); System.out.println ("Time is " + rs.getTime(10).toString());
What I Expected Results: Inserted time: 10:49:32 Time getting back: 10:49:32
What I Saw Instead Results: Inserted time: 10:49:32 Time getting back: 00:00:00
The text was updated successfully, but these errors were encountered:
Merge pull request #37 from ModEtchFill/dateStrTest
2b2f97d
[#5] fixing date as str tests
Issue used setObject() while the revised test used setString()
Sorry, something went wrong.
Team concluded not-a-bug.
The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format.
ModEtchFill
No branches or pull requests
This works fine with Oracle DB but does not work with MySQL DB. After setting time with setObject(), I get back time of 00:00:00
What I Did
Java codes:
Statement st = dbConn.createStatement();
PreparedStatement pst = dbConn.prepareStatement(
"insert into jdbc_occ_test (id, int_val, str_val, char_val, float_val, raw_val, blob_val, clob_val, date_val, "
......
pst.setObject(10, new Time(now).toString(), Types.TIME);
pst.executeUpdate();
....
ResultSet rs = st.executeQuery( "select id, int_val, str_val, char_val, float_val, raw_val, blob_val, " +
"clob_val, date_val, time_val, timestamp_val from jdbc_occ_test where id=" + iID_START);
rs.next();
System.out.println ("Time is " + rs.getTime(10).toString());
What I Expected
Results:
Inserted time: 10:49:32
Time getting back: 10:49:32
What I Saw Instead
Results:
Inserted time: 10:49:32
Time getting back: 00:00:00
The text was updated successfully, but these errors were encountered: