由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Re: JDBC 处理日期的问题(日期插入数据库)
相关主题
jdbc statement questiona prepared statement question
user.region or default locale questiondesign question
java date questionRe: 网上哪里有JDBC的入门书呢
Java练习题 1Re: JDBC question: getXXX methods
ThreadLocal 的一个 use caseRe: Need help with EJB
How to connect to SQL2000?Re: JDBC, Java vs. Javascript
关于Exception,CatchRe: JDBC连接SYBASE数据库问题求助。
Java call stored procedure的一个问题Re: JDBC and Sybase
相关话题的讨论汇总
话题: string话题: date话题: insert话题: format话题: dt
进入Java版参与讨论
1 (共1页)
s***m
发帖数: 28
1
The easiest way i can think of to insert the current date
into database is as follow.
Assume you have a Statement object stmt.
format your data string as follow
*********************************************************
String dt = new SimpleDateFormat().format(new Date());
*********************************************************
then execute the query of insert like this:
*********************************************************
stmt.executeUpdate(parameter indext, dt);
************************
1 (共1页)
进入Java版参与讨论
相关主题
Re: JDBC and SybaseThreadLocal 的一个 use case
Re: Help! JDBC-ODBC in servlet. Thanks.How to connect to SQL2000?
Re: Interesting thing about JDBC-ODBC! Help please.关于Exception,Catch
Re: how to handle Null in JDBC servlet?Java call stored procedure的一个问题
jdbc statement questiona prepared statement question
user.region or default locale questiondesign question
java date questionRe: 网上哪里有JDBC的入门书呢
Java练习题 1Re: JDBC question: getXXX methods
相关话题的讨论汇总
话题: string话题: date话题: insert话题: format话题: dt