Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v5.0
  HXTT DBF v7.1
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT ACCESS
Problem with date arithmetic and comparisons
Matthew Perkowski
2013-08-26 12:33:56
I am using v5.1 of the HXTT Access driver with JDK 1.7. I am having a problem with SQL where math is done with dates (e.g., add, subtract, etc.) or where dates are compared with each other. For example, the following program causes an exception:

package test;

import java.sql.*;

public class Main {
public static void main(String args[]) throws Exception
{
Class.forName("com.hxtt.sql.access.AccessDriver");

Connection db = DriverManager.getConnection("jdbc:access:/C:\\");

Statement stmt = db.createStatement();

ResultSet rs = stmt.executeQuery("SELECT DATE_ADD(DATE(), INTERVAL 1 DAY);");

rs.next();

System.out.println(rs.getDate(1).toString());

rs.close();

stmt.close();

db.close();
}
}

...

Exception in thread "main" java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 1
at com.hxtt.sql.d3.a(Unknown Source)
at com.hxtt.sql.d3.a(Unknown Source)
at com.hxtt.sql.d3.a(Unknown Source)
at com.hxtt.sql.d3.a(Unknown Source)
at com.hxtt.sql.d3.a(Unknown Source)
at com.hxtt.sql.de.a(Unknown Source)
at com.hxtt.sql.bz.a(Unknown Source)
at com.hxtt.sql.am.a(Unknown Source)
at com.hxtt.sql.am.a(Unknown Source)
at com.hxtt.sql.am.executeQuery(Unknown Source)
at test.Main.main(Main.java:14)

at com.hxtt.global.SQLState.SQLException(Unknown Source)
at com.hxtt.sql.bz.a(Unknown Source)
at com.hxtt.sql.am.a(Unknown Source)
at com.hxtt.sql.am.a(Unknown Source)
at com.hxtt.sql.am.executeQuery(Unknown Source)
at test.Main.main(Main.java:14)
Re:Problem with date arithmetic and comparisons
HXTT Support
2013-08-26 23:18:38
2013-08-27 fixed an ArrayIndexOutOfBoundsException bug on system function since 2013-08-09.

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap