Skip to content
Snippets Groups Projects
Commit ff0076df authored by serebrserg's avatar serebrserg
Browse files

METR-20494: don't use java.time since it does not exist in java 1.6. remove...

METR-20494: don't use java.time since it does not exist in java 1.6. remove extra @Override. The interface was smaller back in 1.6.
parent 46c49ea7
No related branches found
No related tags found
No related merge requests found
...@@ -308,27 +308,22 @@ public class CHConnectionImpl implements CHConnection { ...@@ -308,27 +308,22 @@ public class CHConnectionImpl implements CHConnection {
return false; return false;
} }
@Override
public void setSchema(String schema) throws SQLException { public void setSchema(String schema) throws SQLException {
} }
@Override
public String getSchema() throws SQLException { public String getSchema() throws SQLException {
return null; return null;
} }
@Override
public void abort(Executor executor) throws SQLException { public void abort(Executor executor) throws SQLException {
this.close(); this.close();
} }
@Override
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
} }
@Override
public int getNetworkTimeout() throws SQLException { public int getNetworkTimeout() throws SQLException {
return 0; return 0;
} }
......
...@@ -11,8 +11,6 @@ import java.math.BigInteger; ...@@ -11,8 +11,6 @@ import java.math.BigInteger;
import java.net.URL; import java.net.URL;
import java.sql.*; import java.sql.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
...@@ -238,10 +236,6 @@ public class CHPreparedStatementImpl extends CHStatementImpl implements CHPrepar ...@@ -238,10 +236,6 @@ public class CHPreparedStatementImpl extends CHStatementImpl implements CHPrepar
setTime(parameterIndex, (Time) x); setTime(parameterIndex, (Time) x);
} else if (x instanceof Timestamp) { } else if (x instanceof Timestamp) {
setTimestamp(parameterIndex, (Timestamp) x); setTimestamp(parameterIndex, (Timestamp) x);
} else if (x instanceof LocalDate) {
setDate(parameterIndex, Date.valueOf((LocalDate) x));
} else if (x instanceof LocalDateTime) {
setTimestamp(parameterIndex, Timestamp.valueOf((LocalDateTime) x));
} else if (x instanceof Boolean) { } else if (x instanceof Boolean) {
setBoolean(parameterIndex, ((Boolean) x).booleanValue()); setBoolean(parameterIndex, ((Boolean) x).booleanValue());
} else if (x instanceof InputStream) { } else if (x instanceof InputStream) {
......
...@@ -470,12 +470,10 @@ public class CHStatementImpl implements CHStatement { ...@@ -470,12 +470,10 @@ public class CHStatementImpl implements CHStatement {
return params; return params;
} }
@Override
public void closeOnCompletion() throws SQLException { public void closeOnCompletion() throws SQLException {
closeOnCompletion = true; closeOnCompletion = true;
} }
@Override
public boolean isCloseOnCompletion() throws SQLException { public boolean isCloseOnCompletion() throws SQLException {
return closeOnCompletion; return closeOnCompletion;
} }
......
package ru.yandex.metrika.clickhouse; package ru.yandex.metrika.clickhouse;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/** /**
* Created by zhur on 01/03/16. * Created by zhur on 01/03/16.
...@@ -68,16 +65,4 @@ public class CHUtil { ...@@ -68,16 +65,4 @@ public class CHUtil {
return sb.toString(); return sb.toString();
} }
public static String quoteDate(LocalDate d) {
return "toDate(" + quote(d.format(DateTimeFormatter.ISO_LOCAL_DATE)) + ")";
}
public static String quoteDate(LocalDateTime d) {
return "toDate(" + quote(d.format(DateTimeFormatter.ISO_LOCAL_DATE)) + ")";
}
public static String quoteDateTime(LocalDateTime dt) {
return "toDateTime(" + quote(dt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)) + ")";
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.