Skip to content

Commit

Permalink
Add java.sql.Date type
Browse files Browse the repository at this point in the history
  • Loading branch information
lucarota committed Jul 22, 2024
1 parent 8315656 commit 3ee51f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.ascendix.salesforce</groupId>
<artifactId>salesforce-jdbc</artifactId>
<version>1.6.1${suffix.version}-release</version>
<version>1.6.3${suffix.version}-release</version>
<packaging>jar</packaging>

<name>Salesforce JDBC Driver</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public String getDriverName() {

@Override
public String getDriverVersion() {
return getDriverMajorVersion() + "." + getDriverMinorVersion() + ".1";
return getDriverMajorVersion() + "." + getDriverMinorVersion() + ".3";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ public <S> Expression visit(Select subSelect, S context) {
public <S> Expression visit(JdbcParameter parameter, S context) {
int idx = parameter.getIndex() - 1;
Object o = parameters.get(idx);
fieldValues.put(columnName, getParameter(o));
fieldValues.put(columnName, o);
return null;
}

private static Object getParameter(Object o) {
if (o == null) {
return "NULL";
} else if (o instanceof java.sql.Date date) {
LocalDate localDate = Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDate();
return ParamUtils.SQL_DATE_FORMAT.format(localDate);
} else if (o instanceof Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
Expand Down

0 comments on commit 3ee51f8

Please sign in to comment.