How to cast String to int in EL?

Kazuaki Miyauchi <[email protected]> Mon, 19 Aug 2019 14:16:39 +0900
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <CAFLYOCEkfuNHc6UOrioRrO+zNjtrj25ESyCcDOOhUmifc6T22Q@mail.gmail.com>
 To simple following table.
create table test (member_id int, member_name text);

 In JSP, I accessed as following.
<sql:update var="stmt" dataSource="${kome}">
 insert into test values(?,?)
 <sql:param value="1"/>
 <sql:param value="Miyauchi"/>
</sql:update>

 I've gotten following error.(using Tomcat-9.0.22 and Postgres-11.5)
javax.servlet.jsp.JspException: insert into test values(?,?) : ERROR:
column "member_id" is of type integer but expression is of type
character varying Hint: You will need to rewrite or cast the
expression. Position: 27

 This JSP works under Tomcat-5.5.3 and Postgres-9.0.8.

And, I've gotten the same result using following JSP.

<sql:update var="stmt" dataSource="${kome}">
 insert into test values(?,?)
 <sql:param>1</sql:param>
 <sql:param value="Miyauchi"/>
</sql:update>

 How to cast String to int?

Of course, following JSP works correctly.

<sql:update var="stmt" dataSource="${kome}">
 insert into test values(1,?)
 <sql:param value="Miyauchi"/>
</sql:update>

Regards,                       Kazuaki Miyauchi, Japan