java中执行大量insert语句时候,不报错也不更新数据库的问题?
一个sql语句:
insert into dw_customer
(
TelNo ,
CustAddr ,
CustId ,
OpenLicence,
CustName ,
ShortName,
CustType ,
CertifNo ,
CertifType
)
select
a.cntatl,
a.custad,
a.custno,
a.opcfno,
CONVERT(char(64),b.custna) as custna,
rtrim(CONVERT(char(40),b.custna)) as custnaa,
case when b.custtp= '2 ' then '01 ' else '02 ' end,
substring(rtrim(b.idtfno),1,20) as idtfno,
case
when upper(b.idtftp)= 'A ' then '11 '
when upper(b.idtftp)= 'B ' then '15 '
when upper(b.idtftp)= 'C ' then '15 '
when upper(b.idtftp)= 'D ' then '13 '
when upper(b.idtftp)= 'E ' then '13 '
when upper(b.idtftp)= 'F ' then '15 '
when upper(b.idtftp)= 'G ' then '12 '
when upper(b.idtftp)= 'H ' then '12 '
when upper(b.idtftp)= 'I ' then '12 '
when upper(b.idtftp)= 'J ' then '12 '
when upper(b.idtftp)= 'K ' then '12 '
when upper(b.idtftp)= 'L ' then '12 '
when upper(b.idtftp)= 'M ' then '22 '
when upper(b.idtftp)= 'N ' then '22 '
when upper(b.idtftp)= 'O ' then '22 '
when upper(b.idtftp)= 'P ' then '22 '
when upper(b.idtftp)= 'Z ' then '@I '
else '@I '
end as idtftp
from
knc_corp a,knc_cust b
where
a.custno=b.custno
数据大概是2W条,用的是sqlserver2000,在sql查询分析器中很快就可以插入.但是在java执行中就不行了:
PreparedStatement ps = con.prepareStatement(sql) ;
ps.setString(1, "2007-07-08 ") ;
ps.executeUpdate() ;
con.close() ;
------解决方案--------------------也许你把autocommit设为了false 你提交下