Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
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
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT ACCESS
Problem with date arithmetic and comparisons
Matthew Perkowski
2013-08-26 12:33:56.0
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.0
2013-08-27 fixed an ArrayIndexOutOfBoundsException bug on system function since 2013-08-09.

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap