Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

read date column from AS400

 
sanjeev shrivastev
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Jt400 driver to read from a table (located on AS400 i series server ).
There is issue while reading values from a date type column.
If value inside Date column is greater than 2040-01-01, it returns null. Is there any property which can be set to increase the limit(if any)?
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you getting "null" only from the Jt400 driver? What database are you using? Have you try in the DB tool?
 
sanjeev shrivastev
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes null is only from jt400 driver. Reading the values using ISeries navigator is not an issue. I also get null if i use squirrel SQL client, where i use jt400 driver to connect to the database. And i am using jt400 driver from my java code.
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's something which limits dates to be within the range 1940 to 2039 under certain circumstances, if I recall correctly. This applies only if you're formatting your dates using a two-digit year. So see if you can find something which lets you specify the "date format" in your JDBC driver and specify a 4-digit year there.
 
sanjeev shrivastev
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, these options are available for setting dateformat: "mdy" "dmy" "ymd""usa" "iso" "eur""jis""julian"
Using iso in the connection string does the trick for me.
http://javadoc.midrange.com/jtopen/com/ibm/as400/access/doc-files/JDBCProperties.html#format
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic