IfmxCalendar 类

IfmxCalendar 类用于实现 IfmxCalendarUDT TimeSeries 接口。接口提供对属于类的方法和任何常量的抽象描述。IfmxCalendarUDT 接口指定任何日历类可能需要使用的标准常量。该接口仅旨在供要开发日历类的程序员使用。

通过以下方式创建 IfmxCalendar 对象:
  • 从数据库选择日历
  • 从数据库选择时间系列
  • 对新对象进行实例化以插入到数据库
IfmxCalendar 类为这些情况定义以下构造函数:
IfmxCalendar()

IfmxCalendar(String calName, TimeStamp calStart, 
   TimeStamp patStart, String pattern) 
   throws SQLexception 

IfmxCalendar(String calName, TimeStamp calStart, 
    TimeStamp patStart, IfmxCalendarPattern cPat) 
     throws SQLexception 

当您从数据库选择日历时,getObject 方法用于从结果集抽取日历。GBase 8s JDBC Driver 使用第一个构造函数 IfmxCalendar() 对新的 IfmxCalendar 对象进行实例化。它会创建未初始化任何变量的空对象。

当您在客户机上创建日历来插入到数据库时,使用第二个或第三个构造函数来将对象进行实例化。这些构造函数通过解析输入字符串并使用给定参数来对新对象进行初始化。日历包含嵌入式日历模式。第一个构造函数会使用指定日历模式字符串对 IfmxCalendarPattern 对象进行实例化。第二个构造函数会从指定的 IfmxCalendarPattern 对象复制日历模式。

IfmxCalendar 类提供以下方法。
方法 特征符 描述
getName public String getName() throws SQLException 返回日历名称。
getOffset public int getOffset() throws SQLException 返回日历偏移量。
getStartDate public Timestamp getStartDate() throws SQLException 返回日历开始日期。
getPatStartDate public Timestamp getPatStartDate() throws SQLException 返回与日历关联的日历模式的开始日期。
getPattern public IfmxCalendarPattern getPattern() throws SQLException 返回与日历关联的日历模式。
getSQLTypeName public String getSQLTypeName() throws SQLException 返回对象的 SQL 类型名称:在这种情况下为 calendar。
getStartDate public Timestamp getStartDate() throws SQLException 返回日历开始日期。
getTimestamp FromOffset public Timestamp getTimestampFromOffset() throws SQLException 返回给定偏移量的时间戳记。
getOffsetFrom Timestamp public int getOffsetFromTimestamp() throws SQLException 返回给定时间戳记的偏移量。
readSQL public void readSQL() throws SQLException GBase 8s JDBC Driver 自动调用该方法,以从二进制结果流初始化 IfmxCalendar 对象。
toString public String toString() 返回 IfmxCalendar 对象的字符串表示法。
writeSQL public void writeSQL() throws SQLException 当调用 setObject 方法来将 IfmxCalendar 对象插入要发送到数据库服务器的预编译语句时,由 GBase 8s JDBC Driver 自动调用。