"2000-12-30 12:56:31" to Timestamp

本文介绍如何将特定格式的字符串转换为Java中的Timestamp类型,并设置到预编译语句中。通过实例展示了使用DateFormat进行日期解析的过程。
String str  =   " 2000-12-30 12:56:31 " ;
        DateFormat df 
=  DateFormat.getDateTimeInstance();
java.sql.Timestamp date 
=   new  java.sql.Timestamp(df.parse(str).getTime());

            preStamt.setTimestamp(
1 , date);  //  父-->子类,强制
 
ninja: build stopped: subcommand failed. 行 173805: [2025-09-18T12:56:40.721Z] 12:56:40 ninja failed with: exit status 1173807: [2025-09-18T12:56:40.721Z] #### failed to build some targets (19:05 (mm:ss)) #### 行 173809: [2025-09-18T12:56:40.981Z] >> [Thu Sep 18 12:56:40 UTC 2025][build-odm-pipeline.sh]: FAILED: make target-files-package -j240 行 173811: [2025-09-18T12:56:40.981Z] + echo 'FATAL: failed to build odm by mibuild.' 行 173812: [2025-09-18T12:56:40.981Z] FATAL: failed to build odm by mibuild. 行 173881: [2025-09-18T12:56:41.921Z] + echo 'xb::util::wait_pids: FATAL: failed to build odm_module!' 行 173882: [2025-09-18T12:56:41.921Z] xb::util::wait_pids: FATAL: failed to build odm_module! 行 173951: [2025-09-18T12:56:43.303Z] + echo 'xb::util::wait_pids: FATAL: failed to build vendor target file!' 行 173952: [2025-09-18T12:56:43.303Z] xb::util::wait_pids: FATAL: failed to build vendor target file! 行 174036: [2025-09-18T12:56:46.743Z] result : failure 行 174044: [2025-09-18T12:56:55.395Z] + callback_corgi_status vendor failure 行 174046: [2025-09-18T12:56:55.395Z] + local result=failure 行 174048: [2025-09-18T12:56:55.395Z] + [[ -z failure ]] 行 174054: [2025-09-18T12:56:55.395Z] + retry -s 10 -t 10 -e timeout 60s python3 /home/jenkins/agent/workspace/pangu_build_component_vendor/xbuilder-script/build/api/send_mq.py --type=vendor --result=failure --artfs= --cust= --artfs_comp= 行 174056: [2025-09-18T12:56:55.655Z] {"id": 6825709, "taskType": "vendor", "buildUrl": "https://builder12.pt.miui.com/job/pangu_build_component_vendor/229732/", "result": "failure", "custVersion": "", "machine": "pangu-build-component-vendor-229732-w33tw-zgm5p-r2qk4", "outFiles": [], "atestSuiteGenerateResult": "", "malteseRunId": "0", "errorCode": "120034", "codeOwner": "", "description": "FAILED报错,编译问题", "repositoryOwner": ""} 行 174062: [2025-09-18T12:56:55.655Z] + record_timestamp total failure 行 174064: [2025-09-18T12:56:55.655Z] + local status=failure 行 174068: [2025-09-18T12:56:55.655Z] + echo total:failure:1758200215429 行 174116: [2025-09-18T12:58:25.215Z] ERROR: script returned exit code 1174117: [2025-09-18T12:58:25.215Z] Finished: FAILURE
09-19
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值