在我使用数据表创建的primefaces 3.5表单上,rowKey值不作为List返回,因此我收到以下错误:
JBWEB000309: type JBWEB000066: Exception report
JBWEB000068: message For input string: "foreignPartyId"
JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.
JBWEB000070: exception
javax.servlet.ServletException: For input string: "foreignPartyId"
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
JBWEB000071: root cause
java.lang.NumberFormatException: For input string: "foreignPartyId"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
java.lang.Integer.parseInt(Integer.java:492)
java.lang.Integer.parseInt(Integer.java:527)
javax.el.ListELResolver.toInteger(ListELResolver.java:407)
javax.el.ListELResolver.getValue(ListELResolver.java:199)
...
Run Code Online (Sandbox Code Playgroud)
我知道原因是因为我试图用Object []数组中的值填充数据表,而不是List.Object []数组实际上是来自getResultList()的值,使用createNativeQuery方法查询Oracle数据库.
我的问题是:如何将Object []数组中的值转换为List以便填充数据表?
我已经尝试使用Arrays.toList()方法,然后迭代将值添加到列表中,但据我所知,它只返回已支持数组的固定大小列表.它不返回值列表.
任何帮助将不胜感激.如果我没有提供足够的细节,我表示歉意.谢谢.
我有一个表,我需要在其中更改多行中几列的值。
要更改值的表如下所示:
我尝试包含更新值但没有成功的代码是:
UPDATE <table_name>
SET (IDENTIFIER_1, IDENTIFIER_2)
VALUES (1635, 1755),
(2024, 2199),
(1868, 1692),
(3577, 4825)
WHERE ID
IN ('1',
'23',
'54',
'21');
Run Code Online (Sandbox Code Playgroud)
老实说,我不确定 db2 SQL 是否支持这一点。错误是:
- [错误代码:-104,SQL 状态:42601] DB2 SQL 错误:SQLCODE=-104,SQLSTATE=42601,SQLERRMC=update *
我还应该建议我是 db2 新手。