空字符串分隔

[size=large]
[color=blue]Spring+struts+sqlmap[/color]
D124Bean d124Bean = (D124Bean) this.getBean("d124Bean");
MapModel d124 = new MapModel();
// 计划内容
String d124_03 = this.getValueFromObject("d124_03", this.getModel())
+ "";
// 计划开始时间
Object beginTime = this.getValueFromObject("d124_04", this.getModel));
// 计划结束时间
Object endTime = this.getValueFromObject("d124_05", this.getModel());
String d124_04 = "";
String d124_05 = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (beginTime instanceof java.util.Date) {
if (beginTime != null)
d124_04 = sdf.format(beginTime);
} else {
if (beginTime != null)
d124_04 = this.getValueFromObject("d124_04", this
.getModel())+ "";
}
if (endTime instanceof java.util.Date) {
if (endTime != null)
d124_05 = sdf.format(endTime);
} else {
if (endTime != null)
d124_05 = this.getValueFromObject("d124_05", this.getModel())+ "";
}
d124_04 = d124_04.replace(",", " ,") + " ";
d124_05 = d124_05.replace(",", " ,") + " ";
String conArr[] = d124_03.split(",");
String beginArr[] = d124_04.split(",");
String endArr[] = d124_05.split(",");

for (int i = 0; i < conArr.length; i++) {
d124.put("d124_02", reportId);
d124.put("d124_03", conArr[i]);
if (beginArr[i].trim() != null&& !"".equals(beginArr[i].trim())) {
d124.put("d124_04", sdf.parse(beginArr[i]));
}
if (endArr[i].trim() != null && !"".equals(endArr[i].trim())) {
d124.put("d124_05", sdf.parse(endArr[i]));
}

d124Bean.insert(d124, this.getStore(), this.getConnSession());[/size]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值