Topic: java日期插入oracl出錯????﹗﹗﹗﹗﹗?????? |
Print this page |
1.java日期插入oracl出錯????﹗﹗﹗﹗﹗?????? | Copy to clipboard |
Posted by: skwujinhua Posted on: 2009-04-29 09:11 java 日期格式 wdb apr 29 09:08:00 CST 2009 插入oracl時﹐參數:time = new Date(); 以time做實參傳寫oracl時為什么老提示﹕year must be between -4713 and +9999,and not be 0; 為什么范圍錯? 害我將time轉成yyyy-mm-dd hh:mm:ss格式字符串后﹐在SQL語句中用oracl的to_date("","");才能插入成功。 哪個有好辦法﹐直接傳time到oracl就行啊﹐從日期轉到字符再在oracl中轉日期太麻煩了。 |
2.Re:java日期插入oracl出錯????﹗﹗﹗﹗﹗?????? [Re: skwujinhua] | Copy to clipboard |
Posted by: junyuo Posted on: 2009-04-29 09:22 you can use sysdate in your sql statement |
3.Re:java日期插入oracl出錯????﹗﹗﹗﹗﹗?????? [Re: skwujinhua] | Copy to clipboard |
Posted by: skwujinhua Posted on: 2009-04-30 08:00 這個系統要求時間比較精確﹐數據庫不是在本機上﹐數據庫所在機器時間與本機不一樣﹐且要求寫本機的時間作為LOG時間。所以只能寫本機時間到數據庫中。 我想java應該有yyyy-mm-dd hh:mm:ss時間格式吧? |
4.Re:java日期插入oracl出錯????﹗﹗﹗﹗﹗?????? [Re: skwujinhua] | Copy to clipboard |
Posted by: JiafanZhou Posted on: 2009-05-01 23:58 skwujinhua wrote: It is a good guess, everything is available in JAVA... (maybe not everything)
For more details, check the JavaAPI of SimpleDateFormat. Jiafan |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |