vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| i am working with PostgreSQL 8.0.0 and the programming lang used is java i have a stored procedure which inserts a row in a table to this stored procedure i pass the values which have to be inserted in that row. now, i execute this query(which is a call to stored procedure) this execute query is in a try block and i catch SQL exception for it. The question is that is from this SQLException can i detect if it is a foreign key violation, i saw there is a method on SQLException, e.getErrorCode, is ther specific error code for Foreign Key violation, thanks, regards Surabhi |
| ||||
| On Mon, 17 Apr 2006, surabhi.ahuja wrote: > The question is that is from this SQLException can i detect if it is a > foreign key violation, > You should check the value of SQLException.getSQLState() against this table: http://www.postgresql.org/docs/8.1/s...-appendix.html Kris Jurka ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |