Skip to content

Commit bf5ec17

Browse files
iroquetaBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:ServerNowOracle' into beta
1 parent 959b924 commit bf5ec17

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

java/src/main/java/com/genexus/db/driver/GXDBMSdameng.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void onConnection(GXConnection con) {
106106
}
107107

108108
public java.util.Date serverDateTime(GXConnection con) throws SQLException {
109-
ResultSet rslt = con.getStatement("_ServerDT_", "SELECT LOCALTIMESTAMP()", false).executeQuery();
109+
ResultSet rslt = con.getStatement("_ServerDT_", "SELECT CAST(LOCALTIMESTAMP() AS TIMESTAMP)", false).executeQuery();
110110

111111
rslt.next();
112112
Date value = rslt.getTimestamp(1);

java/src/main/java/com/genexus/db/driver/GXDBMSoracle7.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.sql.*;
55
import java.util.Date;
66

7+
import com.genexus.Application;
78
import com.genexus.CommonUtil;
89

910
public class GXDBMSoracle7 implements GXDBMS
@@ -127,7 +128,10 @@ public void onConnection(GXConnection con)
127128

128129
public java.util.Date serverDateTime(GXConnection con) throws SQLException
129130
{
130-
ResultSet rslt = con.getStatement("_ServerDT_", "SELECT SYSTIMESTAMP FROM DUAL", false).executeQuery();
131+
String sqlSentence = "SELECT SYSTIMESTAMP FROM DUAL";
132+
if (!Application.getClientPreferences().useTimezoneFix())
133+
sqlSentence = "SELECT CAST(SYSTIMESTAMP AS TIMESTAMP) FROM DUAL";
134+
ResultSet rslt = con.getStatement("_ServerDT_", sqlSentence, false).executeQuery();
131135

132136
rslt.next();
133137
Date value = rslt.getTimestamp(1);

0 commit comments

Comments
 (0)