本文整理汇总了Java中org.hsqldb.HsqlDateTime.getTimeString方法的典型用法代码示例。如果您正苦于以下问题:Java HsqlDateTime.getTimeString方法的具体用法?Java HsqlDateTime.getTimeString怎么用?Java HsqlDateTime.getTimeString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.HsqlDateTime
的用法示例。
在下文中一共展示了HsqlDateTime.getTimeString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTime
import org.hsqldb.HsqlDateTime; //导入方法依赖的package包/类
/**
* <!-- start generic documentation -->
* Sets the designated parameter to the given <code>java.sql.Time</code>
* value, using the given <code>Calendar</code> object. The driver uses
* the <code>Calendar</code> object to construct an SQL <code>TIME</code>
* value, which the driver then sends to the database. With a
* a <code>Calendar</code> object, the driver can calculate the time
* taking into account a custom timezone. If no
* <code>Calendar</code> object is specified, the driver uses the default
* timezone, which is that of the virtual machine running the
* application. <p>
* <!-- end generic documentation -->
*
* @param parameterIndex the first parameter is 1, the second is 2, ...
* @param x the parameter value
* @param cal the <code>Calendar</code> object the driver will use
* to construct the time
* @exception SQLException if a database access error occurs
* @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
* jdbcPreparedStatement)
*/
// [email protected] 20020414 - patch 517028 by [email protected] - method defined
// changes by fredt - moved conversion to HsqlDateTime
public void setTime(int parameterIndex, java.sql.Time x,
Calendar cal) throws SQLException {
String s;
try {
s = HsqlDateTime.getTimeString(x, cal);
} catch (Exception e) {
throw jdbcUtil.sqlException(Trace.INVALID_ESCAPE, e.getMessage());
}
setParameter(parameterIndex, s);
}
示例2: setTime
import org.hsqldb.HsqlDateTime; //导入方法依赖的package包/类
/**
* <!-- start generic documentation -->
* Sets the designated parameter to the given <code>java.sql.Time</code>
* value, using the given <code>Calendar</code> object. The driver uses
* the <code>Calendar</code> object to construct an SQL <code>TIME</code>
* value, which the driver then sends to the database. With a
* a <code>Calendar</code> object, the driver can calculate the time
* taking into account a custom timezone. If no
* <code>Calendar</code> object is specified, the driver uses the default
* timezone, which is that of the virtual machine running the
* application. <p>
* <!-- end generic documentation -->
*
* @param parameterIndex the first parameter is 1, the second is 2, ...
* @param x the parameter value
* @param cal the <code>Calendar</code> object the driver will use
* to construct the time
* @exception SQLException if a database access error occurs
* @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
* jdbcPreparedStatement)
*/
// [email protected] 20020414 - patch 517028 by [email protected] - method defined
// changes by fredt - moved conversion to HsqlDateTime
public void setTime(int parameterIndex, Time x,
Calendar cal) throws SQLException {
String s;
try {
s = HsqlDateTime.getTimeString(x, cal);
} catch (Exception e) {
throw Util.sqlException(Trace.INVALID_ESCAPE, e.toString());
}
setParameter(parameterIndex, s);
}