Index: utils/modeshape-jdbc/src/main/java/org/modeshape/jdbc/util/TimestampWithTimezone.java =================================================================== --- utils/modeshape-jdbc/src/main/java/org/modeshape/jdbc/util/TimestampWithTimezone.java (revision 0) +++ utils/modeshape-jdbc/src/main/java/org/modeshape/jdbc/util/TimestampWithTimezone.java (revision 0) @@ -0,0 +1,205 @@ +/* + * JBoss, Home of Professional Open Source. + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA. + */ + +package org.modeshape.jdbc.util; + +import java.sql.Date; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.TimeZone; + +import org.modeshape.jdbc.JcrType; + + + +/** + * Utility methods for SQL Timestamps, Time, and Dates with time zones as UTC + * + * This is intended to take incoming Strings or Dates that have accurate + * Calendar fields and give the UTC time by interpretting those fields + * in the target time zone. + * + * Use of the Calendar object passed in will not be thread safe, but + * it will not alter the contents of the Calendar. + * + * Note that normalization occurs only for the transition from one type to another. + * + */ +public class TimestampWithTimezone { + + private static ThreadLocal CALENDAR = new ThreadLocal() { + @Override + protected Calendar initialValue() { + return Calendar.getInstance(); + } + }; + + public static Calendar getCalendar() { + return CALENDAR.get(); + } + + public static void resetCalendar(TimeZone tz) { + TimeZone.setDefault(tz); + CALENDAR.set(Calendar.getInstance()); + } + + public static Object create(java.util.Date date, TimeZone initial, Calendar target, Class type) { + if (type.equals(JcrType.DefaultDataTypes.DATE)) { + return type.cast(createTime(date, initial, target)); + } + return type.cast(createTimestamp(date, initial, target)); + } + + public static Timestamp createTimestamp(java.util.Date date, TimeZone initial, Calendar target) { + if (target == null) { + target = getCalendar(); + } + + long time = target.getTimeInMillis(); + + adjustCalendar(date, initial, target); + + target.set(Calendar.MILLISECOND, 0); + + Timestamp tsInTz = new Timestamp(target.getTimeInMillis()); + + if(date instanceof Timestamp) { + tsInTz.setNanos(((Timestamp)date).getNanos()); + } + + target.setTimeInMillis(time); + return tsInTz; + } + + public static Time createTime(java.util.Date date, TimeZone initial, Calendar target) { + if (target == null) { + target = getCalendar(); + } + + long time = target.getTimeInMillis(); + + adjustCalendar(date, initial, target); + + Time result = normalizeTime(date, target); + + target.setTimeInMillis(time); + return result; + } + + public static Date createDate(java.util.Date date, TimeZone initial, Calendar target) { + if (target == null) { + target = getCalendar(); + } + + long time = target.getTimeInMillis(); + + adjustCalendar(date, initial, target); + + Date result = normalizeDate(date, target); + + target.setTimeInMillis(time); + return result; + } + + /** + * Creates normalized SQL Time Object + * @param date + * + * @return Time + * @since 4.3 + */ + public static Time createTime(java.util.Date date) { + if (date instanceof Time) { + return (Time)date; + } + Calendar cal = getCalendar(); + cal.setTime(date); + return normalizeTime(date, cal); + } + + /** + * Creates normalized SQL Date Object + * @param date + * + * @return Date + * @since 4.3 + */ + public static Date createDate(java.util.Date date) { + if (date instanceof Date) { + return (Date)date; + } + Calendar cal = getCalendar(); + cal.setTime(date); + return normalizeDate(date, cal); + } + + public static Timestamp createTimestamp(java.util.Date date) { + if (date instanceof Timestamp) { + return (Timestamp)date; + } + return new Timestamp(date.getTime()); + } + + private static Date normalizeDate(java.util.Date date, Calendar target) { + if (!(date instanceof Date)) { + target.set(Calendar.HOUR_OF_DAY, 0); + target.set(Calendar.MINUTE, 0); + target.set(Calendar.SECOND, 0); + target.set(Calendar.MILLISECOND, 0); + } + Date result = new Date(target.getTimeInMillis()); + return result; + } + + private static Time normalizeTime(java.util.Date date, Calendar target) { + if (!(date instanceof Time)) { + target.set(Calendar.YEAR, 1970); + target.set(Calendar.MONTH, Calendar.JANUARY); + target.set(Calendar.DAY_OF_MONTH, 1); + target.set(Calendar.MILLISECOND, 0); + } + Time result = new Time(target.getTimeInMillis()); + return result; + } + + private static void adjustCalendar(java.util.Date date, + TimeZone initial, + Calendar target) { + assert initial != null; + if (initial.hasSameRules(target.getTimeZone())) { + target.setTime(date); + return; + } + + //start with base time + long time = date.getTime(); + + Calendar cal = Calendar.getInstance(initial); + cal.setTimeInMillis(time); + + target.clear(); + for (int i = 0; i <= Calendar.MILLISECOND; i++) { + target.set(i, cal.get(i)); + } + } +} \ No newline at end of file Index: utils/modeshape-jdbc/src/main/java/org/modeshape/jdbc/JcrResultSet.java =================================================================== --- utils/modeshape-jdbc/src/main/java/org/modeshape/jdbc/JcrResultSet.java (revision 2398) +++ utils/modeshape-jdbc/src/main/java/org/modeshape/jdbc/JcrResultSet.java (working copy) @@ -58,6 +58,7 @@ import javax.jcr.query.Row; import javax.jcr.query.RowIterator; import org.modeshape.jdbc.util.IoUtil; +import org.modeshape.jdbc.util.TimestampWithTimezone; /** * @@ -70,6 +71,9 @@ private ResultSetMetaData metadata; private RowIterator rowIter; private Row row; + + /** default Calendar instance for converting date/time/timestamp values */ + private Calendar defaultCalendar; // the object which was last read from Results private Object currentValue = null; @@ -123,7 +127,15 @@ closed = true; columnIndexesByName = Collections.emptyMap(); } + + Calendar getDefaultCalendar() { + if (defaultCalendar == null) { + defaultCalendar = Calendar.getInstance(); + } + return defaultCalendar; + } + /** * {@inheritDoc} * @@ -701,7 +713,7 @@ */ @Override public Date getDate( int columnIndex ) throws SQLException { - return getDate(findColumn(columnIndex)); + return getDate(findColumn(columnIndex), null); } /** @@ -711,7 +723,7 @@ */ @Override public Date getDate( String columnLabel ) throws SQLException { - return (Date)getValueReturn(columnLabel, PropertyType.DATE); + return getDate(columnLabel, null); } /** @@ -722,7 +734,7 @@ @Override public Date getDate( int columnIndex, Calendar cal ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + return getDate(findColumn(columnIndex), cal); } /** @@ -733,7 +745,15 @@ @Override public Date getDate( String columnLabel, Calendar cal ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + Calendar calv = (Calendar)getValueReturn(columnLabel, PropertyType.DATE); + + Date value = new java.sql.Date(calv.getTime().getTime()); + + if (value != null && cal != null) { + return TimestampWithTimezone.createDate(value, + getDefaultCalendar().getTimeZone(), cal); + } + return value; } /** @@ -1023,7 +1043,7 @@ */ @Override public Time getTime( int columnIndex ) throws SQLException { - return getTime(findColumn(columnIndex)); + return getTime(findColumn(columnIndex),null); } /** @@ -1033,9 +1053,8 @@ */ @Override public Time getTime( String columnLabel ) throws SQLException { - Date d = (Date)getValueReturn(columnLabel, PropertyType.DATE); - if (d == null) return null; - return new Time(d.getTime()); + return getTime(columnLabel, null); + } /** @@ -1046,7 +1065,7 @@ @Override public Time getTime( int columnIndex, Calendar cal ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + return getTime(findColumn(columnIndex), cal); } /** @@ -1057,7 +1076,17 @@ @Override public Time getTime( String columnLabel, Calendar cal ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + Calendar d = (Calendar)getValueReturn(columnLabel, PropertyType.DATE); + + if (d == null) return null; + + Time value = new Time(d.getTime().getTime()); + + if (value != null && cal != null) { + value = TimestampWithTimezone.createTime(value, + getDefaultCalendar().getTimeZone(), cal); + } + return value; } /** @@ -1067,7 +1096,7 @@ */ @Override public Timestamp getTimestamp( int columnIndex ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + return getTimestamp(findColumn(columnIndex), null); } /** @@ -1077,7 +1106,7 @@ */ @Override public Timestamp getTimestamp( String columnLabel ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + return getTimestamp(columnLabel, null); } /** @@ -1087,8 +1116,8 @@ */ @Override public Timestamp getTimestamp( int columnIndex, - Calendar cal ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + Calendar cal ) throws SQLException { + return getTimestamp(findColumn(columnIndex), cal); } /** @@ -1099,7 +1128,16 @@ @Override public Timestamp getTimestamp( String columnLabel, Calendar cal ) throws SQLException { - throw new SQLFeatureNotSupportedException(); + Calendar d = (Calendar)getValueReturn(columnLabel, PropertyType.DATE); + if (d == null) return null; + Timestamp value = new Timestamp(d.getTime().getTime()); + + if (value != null && cal != null) { + value = TimestampWithTimezone.createTimestamp(value, + getDefaultCalendar().getTimeZone(), cal); + } + + return value; } /** @@ -1211,7 +1249,8 @@ case PropertyType.BOOLEAN: return value.getBoolean(); case PropertyType.DATE: - return new java.sql.Date(value.getDate().getTime().getTime()); + // return new java.sql.Date(value.getDate().getTime().getTime()); + return value.getDate(); case PropertyType.DOUBLE: return value.getDouble(); case PropertyType.LONG: Index: utils/modeshape-jdbc/src/test/java/org/modeshape/jdbc/TestUtil.java =================================================================== --- utils/modeshape-jdbc/src/test/java/org/modeshape/jdbc/TestUtil.java (revision 2383) +++ utils/modeshape-jdbc/src/test/java/org/modeshape/jdbc/TestUtil.java (working copy) @@ -34,6 +34,8 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; +import java.util.TimeZone; + import javax.jcr.Binary; import javax.jcr.ItemNotFoundException; import javax.jcr.Node; @@ -63,6 +65,9 @@ public static final String REFERENCE = PropertyType.nameFromValue(PropertyType.REFERENCE); public static String[] COLUMN_NAMES; + + public static Calendar CAL_INSTANCE = Calendar.getInstance(TimeZone.getTimeZone("GMT-00:00")); + public static Date DATE_INSTANCE = CAL_INSTANCE.getTime(); public static interface COLUMN_NAME_PROPERTIES { public static final String PROP_A = "propA"; @@ -103,13 +108,14 @@ /* * the tuples data types for each column correspond to @see TYPE_NAMES */ - TUPLES.add(new Object[] {"r1c1", new Long(1), null, null, new Double(1), new Boolean(true), new Date(), + + TUPLES.add(new Object[] {"r1c1", new Long(1), null, null, new Double(1), new Boolean(true), DATE_INSTANCE, new String("Heres my data at r1").getBytes()}); - TUPLES.add(new Object[] {"r2c1", new Long(2), null, null, new Double(2), new Boolean(false), new Date(), + TUPLES.add(new Object[] {"r2c1", new Long(2), null, null, new Double(2), new Boolean(false), DATE_INSTANCE, new String("Heres my data r2 ").getBytes()}); - TUPLES.add(new Object[] {"r3c1", new Long(3), null, null, new Double(3), new Boolean(true), new Date(), + TUPLES.add(new Object[] {"r3c1", new Long(3), null, null, new Double(3), new Boolean(true), DATE_INSTANCE, new String("Heres my data at r3 ").getBytes()}); - TUPLES.add(new Object[] {"r4c1", 4L, null, null, 4D, new Boolean(true).booleanValue(), new Date(), + TUPLES.add(new Object[] {"r4c1", 4L, null, null, 4D, new Boolean(true).booleanValue(), DATE_INSTANCE, new String("Heres my data r4 ").getBytes()}); } Index: utils/modeshape-jdbc/src/test/java/org/modeshape/jdbc/JcrResultSetTest.java =================================================================== --- utils/modeshape-jdbc/src/test/java/org/modeshape/jdbc/JcrResultSetTest.java (revision 2383) +++ utils/modeshape-jdbc/src/test/java/org/modeshape/jdbc/JcrResultSetTest.java (working copy) @@ -23,16 +23,22 @@ */ package org.modeshape.jdbc; +import static org.junit.Assert.assertEquals; + import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.notNullValue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import java.io.IOException; +import java.sql.Date; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLFeatureNotSupportedException; +import java.text.DateFormat; import java.util.Calendar; +import java.util.TimeZone; + import javax.jcr.query.QueryResult; import org.junit.After; import org.junit.Before; @@ -262,6 +268,40 @@ } } + + @Test + public void shouldCallGetDateUsingColumnNameAndCalendar() throws SQLException { + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-06:00")); + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + java.sql.Date resultDate = resultSet.getDate(TestUtil.COLUMN_NAMES[col], cal); + + // take the tuple date and turn it into the java.sql.Date that should be returned + Object[] tuple = TestUtil.TUPLES.get(i); + java.util.Date d = (java.util.Date) tuple[col]; + + cal.setTimeInMillis(d.getTime()); + + java.sql.Date expectedDate = new java.sql.Date(cal.getTime().getTime()); + + String expected = DateFormat.getDateInstance().format(expectedDate); + String resultis = DateFormat.getDateInstance().format(resultDate); + assertEquals(expected, resultis); + } + } + + @Test( expected = java.lang.AssertionError.class ) + public void shouldThrowExceptionGetDateUsingColumnNameAndCalendar() throws SQLException { + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-06:00")); + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + Object[] tuple = TestUtil.TUPLES.get(i); + assertThat(resultSet.getDate(TestUtil.COLUMN_NAMES[col], cal), is(tuple[col])); + } + } + @Test public void shouldCallGetDateUsingColmnIndex() throws SQLException { @@ -274,6 +314,29 @@ } } + + @Test + public void shouldCallGetDateUsingColmnIndexAndCalendar() throws SQLException { + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-06:00")); + + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + + java.sql.Date resultDate = resultSet.getDate(col + 1, cal); + + Object[] tuple = TestUtil.TUPLES.get(i); + java.util.Date d = (java.util.Date) tuple[col]; + cal.setTimeInMillis(d.getTime()); + + java.sql.Date expectedDate = new java.sql.Date(cal.getTime().getTime()); + + String expected = DateFormat.getDateInstance().format(expectedDate); + String resultis = DateFormat.getDateInstance().format(resultDate); + assertEquals(expected, resultis); + + } + } @Test public void shouldCallGetTimeUsingColumnName() throws SQLException { @@ -287,6 +350,29 @@ } } + + + @Test + public void shouldCallGetTimeUsingColumnNameAndCalendar() throws SQLException { + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-06:00")); + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + java.sql.Time resultTime = resultSet.getTime(TestUtil.COLUMN_NAMES[col], cal); + + // take the tuple date and turn it into the java.sql.Date that should be returned + Object[] tuple = TestUtil.TUPLES.get(i); + java.util.Date d = (java.util.Date) tuple[col]; + + cal.setTimeInMillis(d.getTime()); + + java.sql.Time expectedTime = new java.sql.Time(cal.getTime().getTime()); + + String expected = DateFormat.getDateInstance().format(expectedTime); + String resultis = DateFormat.getDateInstance().format(resultTime); + assertEquals(expected, resultis); + } + } @Test public void shouldCallGetTimeUsingColmnIndex() throws SQLException { @@ -302,7 +388,98 @@ } } + + @Test + public void shouldCallGetTimeUsingColmnIndexAndCalendar() throws SQLException { + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-06:00")); + + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + + java.sql.Time resultTime = resultSet.getTime(col + 1, cal); + + Object[] tuple = TestUtil.TUPLES.get(i); + java.util.Date d = (java.util.Date) tuple[col]; + cal.setTimeInMillis(d.getTime()); + + java.sql.Time expectedTime = new java.sql.Time(cal.getTime().getTime()); + + assertEquals(DateFormat.getDateInstance().format(expectedTime), DateFormat.getDateInstance().format(resultTime)); + } + } + + + @Test + public void shouldCallGetTimeStampUsingColumnName() throws SQLException { + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + Object[] tuple = TestUtil.TUPLES.get(i); + long lt = ((java.util.Date)tuple[col]).getTime(); + java.sql.Timestamp t = new java.sql.Timestamp(lt); + assertThat(resultSet.getTimestamp(TestUtil.COLUMN_NAMES[col]), is(t)); + + } + } + + @Test + public void shouldCallGetTimeStampUsingColumnNameAndCalendar() throws SQLException { + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-06:00")); + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + java.sql.Timestamp resultTimestamp = resultSet.getTimestamp(TestUtil.COLUMN_NAMES[col], cal); + + // take the tuple date and turn it into the java.sql.Date that should be returned + Object[] tuple = TestUtil.TUPLES.get(i); + java.util.Date d = (java.util.Date) tuple[col]; + + cal.setTimeInMillis(d.getTime()); + + java.sql.Timestamp expectedTimestamp = new java.sql.Timestamp(cal.getTime().getTime()); + + String expected = DateFormat.getDateInstance().format(expectedTimestamp); + String resultis = DateFormat.getDateInstance().format(resultTimestamp); + assertEquals(expected, resultis); + } + } + + @Test + public void shouldCallGetTimeStampUsingColmnIndex() throws SQLException { + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + Object[] tuple = TestUtil.TUPLES.get(i); + long lt = ((java.util.Date)tuple[col]).getTime(); + java.sql.Timestamp t = new java.sql.Timestamp(lt); + + // need to increment because ResultSet is 1 based. + assertThat(resultSet.getTimestamp(col + 1), is(t)); + } + } + + @Test + public void shouldCallGetTimeStampUsingColmnIndexAndCalendar() throws SQLException { + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT-06:00")); + + int col = getColumnTypeLoc(TestUtil.DATE); + for (int i = 0; i < TestUtil.TUPLES.size(); i++) { + assertThat(resultSet.next(), is(true)); + + java.sql.Timestamp resultTime = resultSet.getTimestamp(col + 1, cal); + + Object[] tuple = TestUtil.TUPLES.get(i); + java.util.Date d = (java.util.Date) tuple[col]; + cal.setTimeInMillis(d.getTime()); + + java.sql.Timestamp expectedTime = new java.sql.Timestamp(cal.getTime().getTime()); + + assertEquals(DateFormat.getDateInstance().format(expectedTime), DateFormat.getDateInstance().format(resultTime)); + } + } + @Test public void shouldCallGetBytesUsingColmnIndex() throws SQLException { int numCols = TestUtil.COLUMN_NAMES.length; @@ -837,22 +1014,6 @@ * @throws SQLException */ @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetDateIdxCal() throws SQLException { - resultSet.getDate(1, Calendar.getInstance()); - } - - /** - * @throws SQLException - */ - @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetDateColNameCal() throws SQLException { - resultSet.getDate("colname", Calendar.getInstance()); - } - - /** - * @throws SQLException - */ - @Test( expected = SQLFeatureNotSupportedException.class ) public void featureNotSupportedCallingGetFloatIdx() throws SQLException { resultSet.getFloat(1); } @@ -980,50 +1141,50 @@ /** * @throws SQLException */ - @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetTimeIdxCal() throws SQLException { - resultSet.getTime(1, null); - } +// @Test( expected = SQLFeatureNotSupportedException.class ) +// public void featureNotSupportedCallingGetTimeIdxCal() throws SQLException { +// resultSet.getTime(1, null); +// } /** * @throws SQLException */ - @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetTimeColNameCal() throws SQLException { - resultSet.getTime("colname", null); - } +// @Test( expected = SQLFeatureNotSupportedException.class ) +// public void featureNotSupportedCallingGetTimeColNameCal() throws SQLException { +// resultSet.getTime("colname", null); +// } /** * @throws SQLException */ - @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetTimestampIdx() throws SQLException { - resultSet.getTimestamp(1); - } +// @Test( expected = SQLFeatureNotSupportedException.class ) +// public void featureNotSupportedCallingGetTimestampIdx() throws SQLException { +// resultSet.getTimestamp(1); +// } /** * @throws SQLException */ - @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetTimestampColName() throws SQLException { - resultSet.getTimestamp("colname"); - } +// @Test( expected = SQLFeatureNotSupportedException.class ) +// public void featureNotSupportedCallingGetTimestampColName() throws SQLException { +// resultSet.getTimestamp("colname"); +// } /** * @throws SQLException */ - @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetTimestampIdxCal() throws SQLException { - resultSet.getTimestamp(1, null); - } +// @Test( expected = SQLFeatureNotSupportedException.class ) +// public void featureNotSupportedCallingGetTimestampIdxCal() throws SQLException { +// resultSet.getTimestamp(1, null); +// } /** * @throws SQLException */ - @Test( expected = SQLFeatureNotSupportedException.class ) - public void featureNotSupportedCallingGetTimestampColNameCal() throws SQLException { - resultSet.getTimestamp("colname", null); - } +// @Test( expected = SQLFeatureNotSupportedException.class ) +// public void featureNotSupportedCallingGetTimestampColNameCal() throws SQLException { +// resultSet.getTimestamp("colname", null); +// } /** * @throws SQLException