Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.131
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol 5.0.131
  HXTT DBF 7.1.132
  HXTT Excel 6.1.135
  HXTT Json 1.0.103
  HXTT Paradox 7.1.131
  HXTT PDF 2.0.131
  HXTT Text(CSV) 7.1.131
  HXTT Word 1.1.131
  HXTT XML 4.0.132
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.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
 

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