@@ -65,6 +65,8 @@ public class CallableStatementTest extends AbstractTest {
6565 .escapeIdentifier (RandomUtil .getIdentifier ("manyParam_Table" ));
6666 private static String manyParamProc = AbstractSQLGenerator
6767 .escapeIdentifier (RandomUtil .getIdentifier ("manyParam_Procedure" ));
68+ private static String currentTimeProc = AbstractSQLGenerator
69+ .escapeIdentifier (RandomUtil .getIdentifier ("currentTime_Procedure" ));
6870 private static String manyParamUserDefinedType = AbstractSQLGenerator
6971 .escapeIdentifier (RandomUtil .getIdentifier ("manyParam_definedType" ));
7072 private static String zeroParamSproc = AbstractSQLGenerator
@@ -108,6 +110,7 @@ public static void setupTest() throws Exception {
108110 createUserDefinedType ();
109111 createTableManyParams ();
110112 createProcedureManyParams ();
113+ createProcedureCurrentTime ();
111114 createGetObjectOffsetDateTimeProcedure (stmt );
112115 createProcedureZeroParams ();
113116 createOutOfOrderSproc ();
@@ -1224,6 +1227,17 @@ public void testFourPartSyntaxCallEscapeSyntax() throws SQLException {
12241227 }
12251228 }
12261229
1230+ @ Test
1231+ public void testTimestampStringConversion () throws SQLException {
1232+ try (CallableStatement stmt = connection .prepareCall ("{call " + currentTimeProc + "(?)}" )) {
1233+ String timestamp = "2024-05-29 15:35:53.461" ;
1234+ stmt .setObject (1 , timestamp , Types .TIMESTAMP );
1235+ stmt .registerOutParameter (1 , Types .TIMESTAMP );
1236+ stmt .execute ();
1237+ stmt .getObject ("currentTimeStamp" );
1238+ }
1239+ }
1240+
12271241 /**
12281242 * Cleanup after test
12291243 *
@@ -1242,6 +1256,7 @@ public static void cleanup() throws SQLException {
12421256 TestUtils .dropProcedureIfExists (zeroParamSproc , stmt );
12431257 TestUtils .dropProcedureIfExists (outOfOrderSproc , stmt );
12441258 TestUtils .dropProcedureIfExists (byParamNameSproc , stmt );
1259+ TestUtils .dropProcedureIfExists (currentTimeProc , stmt );
12451260 TestUtils .dropFunctionIfExists (userDefinedFunction , stmt );
12461261 }
12471262 }
@@ -1294,6 +1309,14 @@ private static void createProcedureManyParams() throws SQLException {
12941309 }
12951310 }
12961311
1312+ private static void createProcedureCurrentTime () throws SQLException {
1313+ String sql = "CREATE PROCEDURE " + currentTimeProc + " @currentTimeStamp datetime = null OUTPUT " +
1314+ "AS BEGIN SET @currentTimeStamp = CURRENT_TIMESTAMP; END" ;
1315+ try (Statement stmt = connection .createStatement ()) {
1316+ stmt .execute (sql );
1317+ }
1318+ }
1319+
12971320 private static void createTableManyParams () throws SQLException {
12981321 String type = manyParamUserDefinedType ;
12991322 String sql = "CREATE TABLE" + manyParamsTable + " (c1 " + type + " null, " + "c2 " + type + " null, " + "c3 "
0 commit comments