1 21 22 package org.apache.derby.impl.tools.ij; 23 24 import org.apache.derby.iapi.tools.i18n.LocalizedResource; 25 import java.io.IOException ; 26 27 36 37 public class ijException extends RuntimeException { 38 39 private final static String IllegalStatementName="IJ_IllegalStatementName"; 40 private final static String NotYetImplemented="IJ_NotYetImpl"; 41 private final static String AlreadyHaveConnectionNamed = "IJ_AlreHaveACon"; 42 private final static String BangException = "IJ_ExceRunnComm"; 43 private final static String ConnectionGetWarningsFailed = "IJ_UnabToGetWar"; 44 private final static String ClassNotFoundForProtocol = "IJ_CoulNotLocaC"; 45 private final static String ClassNotFound = "IJ_CoulNotLocaC_5"; 46 private final static String DisconnectFailed = "IJ_FailToDisc"; 47 private final static String DriverNotClassName = "IJ_DrivNotClasN"; 48 private final static String FileNotFound = "IJ_FileNotFoun"; 49 private final static String ForwardOnlyCursor = "IJ_IsNotAlloOnA"; 50 private final static String GetConnectionFailed = "IJ_GetcCallFail"; 51 private final static String IOException = "IJ_Ioex"; 52 private final static String NeedToDisconnect = "IJ_NeedToDiscFi"; 53 private final static String NoSuchAsyncStatement = "IJ_NoAsynStatEx"; 54 private final static String NoSuchConnection = "IJ_NoConnExisWi"; 55 private final static String NoSuchProtocol = "IJ_NoProtExisWi"; 56 private final static String NoSuchTable = "IJ_NoSuchTable"; 57 private final static String NotJDBC20 = "IJ_IsOnlySuppIn"; 58 private final static String NoUsingResults = "IJ_UsinClauHadN"; 59 private final static String ObjectWasNull = "IJ_UnabToEsta"; 60 private final static String ResultSetGetWarningsFailed = "IJ_UnabToGetWar_19"; 61 private final static String ResourceNotFound = "IJ_ResoNotFoun"; 62 private final static String ScrollCursorsNotSupported = "IJ_ScroCursAre1"; 63 private final static String HoldCursorsNotSupported = "IJ_HoldCursAre4"; 64 private final static String StatementGetWarningsFailed = "IJ_UnabToGetWar_22"; 65 private final static String WaitInterrupted = "IJ_WaitForStatI"; 66 private final static String ZeroInvalidForAbsolute = "IJ_0IsAnInvaVal"; 67 68 public ijException(String message) { 69 super(message); 70 } 71 72 static ijException notYetImplemented() { 73 return new ijException(LocalizedResource.getMessage(NotYetImplemented)); 74 } 75 76 static ijException illegalStatementName(String n) { 77 return new ijException(LocalizedResource.getMessage(IllegalStatementName, n)); 78 } 79 static ijException alreadyHaveConnectionNamed(String n) { 80 return new ijException(LocalizedResource.getMessage(AlreadyHaveConnectionNamed, n)); 81 } 82 static ijException bangException(Throwable t) { 83 return new ijException(LocalizedResource.getMessage(BangException, t.toString())); 84 } 85 static ijException classNotFoundForProtocol(String p) { 86 return new ijException(LocalizedResource.getMessage(ClassNotFoundForProtocol, p)); 87 } 88 static ijException classNotFound(String c) { 89 return new ijException(LocalizedResource.getMessage(ClassNotFound, c)); 90 } 91 static ijException connectionGetWarningsFailed() { 92 return new ijException(LocalizedResource.getMessage(ConnectionGetWarningsFailed)); 93 } 94 static ijException disconnectFailed() { 95 return new ijException(LocalizedResource.getMessage(DisconnectFailed)); 96 } 97 static ijException driverNotClassName(String c) { 98 return new ijException(LocalizedResource.getMessage(DriverNotClassName, c)); 99 } 100 static ijException fileNotFound() { 101 return new ijException(LocalizedResource.getMessage(FileNotFound)); 102 } 103 static public ijException forwardOnlyCursor(String operation) { 104 return new ijException(LocalizedResource.getMessage(ForwardOnlyCursor, operation)); 105 } 106 static ijException resourceNotFound() { 107 return new ijException(LocalizedResource.getMessage(ResourceNotFound)); 108 } 109 static ijException getConnectionFailed() { 110 return new ijException(LocalizedResource.getMessage(GetConnectionFailed)); 111 } 112 static ijException iOException(IOException t) { 113 return new ijException(LocalizedResource.getMessage(IOException, t.getMessage())); 114 } 115 static ijException needToDisconnect() { 116 return new ijException(LocalizedResource.getMessage(NeedToDisconnect)); 117 } 118 static ijException noSuchAsyncStatement(String c) { 119 return new ijException(LocalizedResource.getMessage(NoSuchAsyncStatement, c)); 120 } 121 static ijException noSuchConnection(String c) { 122 return new ijException(LocalizedResource.getMessage(NoSuchConnection, c)); 123 } 124 static ijException noSuchProtocol(String c) { 125 return new ijException(LocalizedResource.getMessage(NoSuchProtocol, c)); 126 } 127 static ijException noSuchTable(String c) { 128 return new ijException(LocalizedResource.getMessage(NoSuchTable, c)); 129 } 130 static public ijException notJDBC20(String operation) { 131 return new ijException(LocalizedResource.getMessage(NotJDBC20, operation)); 132 } 133 static ijException noUsingResults() { 134 return new ijException(LocalizedResource.getMessage(NoUsingResults)); 135 } 136 static public ijException objectWasNull(String objectName) { 137 return new ijException(LocalizedResource.getMessage(ObjectWasNull, objectName)); 138 } 139 static ijException resultSetGetWarningsFailed() { 140 return new ijException(LocalizedResource.getMessage(ResultSetGetWarningsFailed)); 141 } 142 static ijException scrollCursorsNotSupported() { 143 return new ijException(LocalizedResource.getMessage(ScrollCursorsNotSupported)); 144 } 145 public static ijException holdCursorsNotSupported() { 148 return new ijException(LocalizedResource.getMessage(HoldCursorsNotSupported)); 149 } 150 static ijException statementGetWarningsFailed() { 151 return new ijException(LocalizedResource.getMessage(StatementGetWarningsFailed)); 152 } 153 static ijException waitInterrupted(Throwable t) { 154 return new ijException(LocalizedResource.getMessage(WaitInterrupted, t.toString())); 155 } 156 public static ijException zeroInvalidForAbsolute() { 157 return new ijException(LocalizedResource.getMessage(ZeroInvalidForAbsolute)); 158 } 159 } 160 | Popular Tags |