java 写入 clob_用Java写入CLOB

现在我们使用下面的代码将数据写入.csv文件(即创建)

但现在我必须直接将这些数据更新到一个数据库列CLOB。

而不会生成任何.csv文件。

我如何将这些数据添加到CLOB。

这里我们将每一行都作为vectorIT()传递给writeIT(),并将它添加到filewriter中。

我应该怎么做才能在CLOB中编写它?

请帮我解决..

writeIt(mlh);

writeIt(row);

writeIt(null);

writeIt(commentLineHeader);

writeIt(row);

protected void writeIt (Vector a){

if (filewriter==null) return;

try {

if (a!=null){

for (int i=0;i

//Object o=a.elementAt(i);

Object o=a.elementAt(i);

if (o!=null) {

String str=o.toString();

// replacing an komma inside a string with a point.

str = str.replace(',','.');

// replacing a new line in hexa it's 0A and 0F with blank

str = str.replace('\n',' '); // LF replace

str = str.replace('\r',' '); // CR replace

filewriter.write(str);

}

if (i!=a.size()-1) filewriter.write(",");

}

}

}

catch (IOException e){

errH.addMessage(L_ERROR,"_$EXCEPTION_RAISED -" + e.toString());

PAVSessionManager.getInstance().update_in_use_flag();

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值