aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-03 11:12:55 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-03 11:12:55 +1200
commit427113e0aabf1b8ab54288263c3e809f292a5a05 (patch)
tree7a09673050424df35c542be0538bedb10289fe9c /src/org/traccar/database
parentdb0af8a22724d153baf5a12edc1eb5ee551fbc14 (diff)
downloadtraccar-server-427113e0aabf1b8ab54288263c3e809f292a5a05.tar.gz
traccar-server-427113e0aabf1b8ab54288263c3e809f292a5a05.tar.bz2
traccar-server-427113e0aabf1b8ab54288263c3e809f292a5a05.zip
Remove unused fromRecord method
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/Convertable.java7
-rw-r--r--src/org/traccar/database/ObjectConverter.java34
2 files changed, 1 insertions, 40 deletions
diff --git a/src/org/traccar/database/Convertable.java b/src/org/traccar/database/Convertable.java
index 4653a815a..cc1a88ceb 100644
--- a/src/org/traccar/database/Convertable.java
+++ b/src/org/traccar/database/Convertable.java
@@ -15,7 +15,6 @@
*/
package org.traccar.database;
-import java.sql.ResultSet;
import javax.json.JsonObject;
public interface Convertable {
@@ -23,9 +22,5 @@ public interface Convertable {
public JsonObject toJson();
public void fromJson(JsonObject json) throws Exception;
-
- //public void toRecord();
-
- public void fromRecord(ResultSet record);
-
+
}
diff --git a/src/org/traccar/database/ObjectConverter.java b/src/org/traccar/database/ObjectConverter.java
index 7852c88f4..5a7f7083a 100644
--- a/src/org/traccar/database/ObjectConverter.java
+++ b/src/org/traccar/database/ObjectConverter.java
@@ -15,9 +15,6 @@
*/
package org.traccar.database;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -45,16 +42,6 @@ public class ObjectConverter {
return array.build();
}
- private static boolean hasColumn(ResultSet resultSet, String columnName) throws SQLException {
- ResultSetMetaData metaData = resultSet.getMetaData();
- for (int i = 1; i <= metaData.getColumnCount(); i++) {
- if (columnName.equalsIgnoreCase(metaData.getColumnName(i))) {
- return true;
- }
- }
- return false;
- }
-
public static String getString(JsonObject json, String key) {
if (json.containsKey(key)) {
return json.getString(key);
@@ -62,13 +49,6 @@ public class ObjectConverter {
return null;
}
- public static String getString(ResultSet record, String key) throws SQLException {
- if (hasColumn(record, key)) {
- return record.getString(key);
- }
- return null;
- }
-
public static void putString(JsonObjectBuilder json, String key, String value) {
if (value != null) {
json.add(key, value);
@@ -82,13 +62,6 @@ public class ObjectConverter {
return 0;
}
- public static long getLong(ResultSet record, String key) throws SQLException {
- if (hasColumn(record, key)) {
- return record.getLong(key);
- }
- return 0;
- }
-
public static void putLong(JsonObjectBuilder json, String key, long value) {
json.add(key, value);
}
@@ -104,13 +77,6 @@ public class ObjectConverter {
return null;
}
- public static Date getDate(ResultSet record, String key) throws SQLException {
- if (hasColumn(record, key)) {
- return record.getDate(key);
- }
- return null;
- }
-
public static void putDate(JsonObjectBuilder json, String key, Date value) {
if (value != null) {
json.add(key, dateFormat.format(value));