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
SQLException.getNextException() having further error message
Daniel Kim
2006-01-10 00:00:00.0
hi!

I am inserting oracle data into Access and this stmt works in Access, but doesn't work in java code and have this error msg and I using HXTT driver. How do I get further exception message? (other similiar insert stmts work, but not this one.)

INSERT INTO [Med Prof Work History]([Med Prof Record No], [Order], [WorkFromDate], [WorkThruDate], [CompanyName], [WorkAddress], [WorkAddress2], [WorkCity] ,[WorkState], [WorkCountry], [WorkZipCode], [PositionHeld], [ContactName], [ContactTitle], [WorkPhone], [WorkFaxNumber],[Comments],[LastUpdated], [UpdatedBy])
VALUES (245, 1, '11/1990', '01/2000', 'sdfgsdfg', 'sdfsg', 'sdfsg', 'sdfg', 'AK', 'United States', '21133', 'asdfasdf', 'asdfas', 'asdfa', '2222222222', '222 222 2222', 'asdfa', '10/01/2006', 'cred')

Error(resultDAO): java.sql.SQLException: Failed to insert a new record into table Med Prof Work History! For more information, please use SQLException.getNextException().

thx,
Re:SQLException.getNextException() having further error message
Daniel Kim
2006-01-10 00:00:00.0
Data types for the Access table is the following:

[Med Prof Record No], [Order] --> Number
[WorkFromDate], [WorkThruDate],[LastUpdated]--> Date/time
others --> Text

+++++++++++++++++++++++++
String insertSql = "INSERT INTO " + "[Med Prof Work History]" + "(" +

"[Med Prof Record No]," +
"[Order]," +
"[WorkFromDate]," +
"[WorkThruDate]," +
"[CompanyName]," +
"[WorkAddress]," +
"[WorkAddress2]," +
"[WorkCity]," +
"[WorkState]," +
"[WorkCountry]," +
"[WorkZipCode]," +
"[PositionHeld]," +
"[ContactName]," +
"[ContactTitle]," +
"[WorkPhone]," +
"[WorkFaxNumber]," +
"[Comments]," +//reason for leaving
"[LastUpdated], " +
"[UpdatedBy]) " +//19

//TO_CHAR(WorkFromDate, 'MM/YYYY')

"VALUES ("+accessMedProfRecordNo+", " +
""+orderNo+", " +
//"TO_CHAR([WorkFromDate],"+"'"+Converters.convertDateMMYYYY((String)hm.get("date_from"))+"'), " +
//"TO_CHAR([WorkThruDate],"+"'"+Converters.convertDateMMYYYY((String)hm.get("date_to"))+"'), " +
"'"+Converters.convertDateMMYYYY((String)hm.get("date_from"))+"', " +
"'"+Converters.convertDateMMYYYY((String)hm.get("date_to"))+"', " +
"'"+(String)hm.get("company_name")+"', " +
"'"+(String)hm.get("address_one")+"', " +
"'"+(String)hm.get("address_two")+"', " +
"'"+(String)hm.get("city")+"', " +
"'"+(String)hm.get("state")+"', " +
"'"+(String)hm.get("country")+"', " +
"'"+(String)hm.get("zip")+"', " +
"'"+(String)hm.get("position")+"', " +
"'"+(String)hm.get("contact_name")+"', " +
"'"+(String)hm.get("contact_title")+"', " +
"'"+(String)hm.get("phone")+"', " +
"'"+(String)hm.get("fax")+"', " +
"'"+(String)hm.get("reason_leaving")+"', " +

"'"+Converters.getDateTimeMMDDYYYY()+"', " +
"'"+Constants.WHOLOGGEDIN+"') ";//19
Re:Re:SQLException.getNextException() having further error message
HXTT Support
2006-01-10 00:00:00.0
You can use:
catch( SQLException sqle )
{
do
{
System.out.println(sqle.getMessage());
System.out.println("Error Code:"+sqle.getErrorCode());
System.out.println("SQL State:"+sqle.getSQLState());
sqle.printStackTrace();
}while((sqle=sqle.getNextException())!=null);
}
I guess that your issue was resulted by '11/1990', '01/2000', '10/01/2006', you should use '1990/11/1', '2000/01/01', and '20006/10/01' in sql.


Re:Re:Re:SQLException.getNextException() having further error message
HXTT Support
2006-01-10 00:00:00.0
I guess that you can try to replace:
Converters.convertDateMMYYYY((String)hm.get("date_from")) with hm.get("date_from") since HXTT Access can guess most of 'yyyy-mm-dd', 'yyyy-m-d', and so on. What's your original date string format?
Converters.getDateTimeMMDDYYYY() with now() or date() function;

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