01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.resource.adapter.jdbc.vendor;
23:
24: import java.io.Serializable;
25: import java.sql.SQLException;
26: import org.jboss.resource.adapter.jdbc.ExceptionSorter;
27:
28: /**
29: * InformixExceptionSorter.java
30: *
31: * This is a basic exception sorter for the IBM INFORMIX 9.4 RDBMS. All error
32: * codes are taken from the IBM INFORMIX JDBC driver programmer's guide of the
33: * 2.21.JC6 JDBC driver.
34: *
35: * @author <a href="mailto:u.schroeter@mobilcom.de">Ulf Schroeter</a>
36: */
37: public class InformixExceptionSorter implements ExceptionSorter,
38: Serializable {
39: static final long serialVersionUID = -7135889081050258852L;
40:
41: public boolean isExceptionFatal(SQLException e) {
42: switch (e.getErrorCode()) {
43: case -710: //Table has been dropped, altered or renamed JBAS-3120
44: case -79716: // System or internal error
45: case -79730: // Connection noit established
46: case -79734: // INFORMIXSERVER has to be specified
47: case -79735: // Can't instantiate protocol
48: case -79736: // No connection/statement established yet
49: case -79756: // Invalid connection URL
50: case -79757: // Invalid subprotocol
51: case -79758: // Invalid IP address
52: case -79759: // Invalid port nnumber
53: case -79760: // Invalid database name
54: case -79788: // User name must be specified
55: case -79811: // Connection without user/password not supported
56: case -79812: // User/password does not match with datasource
57: case -79836: // Proxy error: no database connection
58: case -79837: // Proxy error: IO error
59: case -79879: // Unexpected exception
60:
61: return true;
62: }
63:
64: return false;
65: }
66:
67: } // InformixExceptionSorter
|