java jdbc sql 特殊字符 尖括号处理
insertintoDataSourceValue(ID,P_ID,SourceName,DisplayPath,ValuePath,Items,Status)value...
insert into DataSourceValue
(ID,P_ID,SourceName,DisplayPath,ValuePath,Items,Status)
values
('00000000000000000000000000000001','00000000000000000000000000000004','性别','','',
'
男1女2其他0
',1);
这个在plsql执行没问题,但用java jdbc 就要报错java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 应该是尖括号的问题求解决
insert into DataSourceValue
(ID,P_ID,SourceName,DisplayPath,ValuePath,Items,Status)
values
(''00000000000000000000000000000001'',''00000000000000000000000000000004'',''性别'','''','''',
''
<Item>
<Text>男<//Text>
<Value>1<//Value>
<//Item>
<Item>
<Text>女<//Text>
<Value>2<//Value>
<//Item>
<Item>
<Text>其他<//Text>
<Value>0<//Value>
<//Item>
'',1); 展开
(ID,P_ID,SourceName,DisplayPath,ValuePath,Items,Status)
values
('00000000000000000000000000000001','00000000000000000000000000000004','性别','','',
'
男1女2其他0
',1);
这个在plsql执行没问题,但用java jdbc 就要报错java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 应该是尖括号的问题求解决
insert into DataSourceValue
(ID,P_ID,SourceName,DisplayPath,ValuePath,Items,Status)
values
(''00000000000000000000000000000001'',''00000000000000000000000000000004'',''性别'','''','''',
''
<Item>
<Text>男<//Text>
<Value>1<//Value>
<//Item>
<Item>
<Text>女<//Text>
<Value>2<//Value>
<//Item>
<Item>
<Text>其他<//Text>
<Value>0<//Value>
<//Item>
'',1); 展开
若以下回答无法解决问题,邀请你更新回答
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询