Hi, I am using DBTags, how to catch an exception when the user try to insert
the same field ( that is a pimary key) and show the user that the field
already exist ?
Here is what I have, I was trying to insert a new row with an IP_Address
that already exist, but I got an exception :
<sql:statement id="stmt1" conn="conn1">
<%-- set the SQL query --%>
<sql:query>
insert into pcinfo (IP_Address, User, New_Name, Domain, Jack_Number, OS,
PC, Processor, Memory)
values (
'<sql:escapeSql><%=request.getParameter("ipaddress")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("user")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("newname")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("domain")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("jack")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("os")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("pc")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("processor")%></sql:escapeSql>',
'<sql:escapeSql><%=request.getParameter("memory")%></sql:escapeSql>')
</sql:query>
<%-- execute the query --%>
<sql:execute/>
</sql:statement>
thanks
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com