@@ -82,7 +82,7 @@ final void setDriverErrorCode(int value) {
82
82
83
83
/**
84
84
* Log an exception to the driver log file
85
- *
85
+ *
86
86
* @param o
87
87
* the io buffer that generated the exception
88
88
* @param errText
@@ -91,8 +91,8 @@ final void setDriverErrorCode(int value) {
91
91
* true to generate the stack trace
92
92
*/
93
93
/* L0 */ private void logException (Object o ,
94
- String errText ,
95
- boolean bStack ) {
94
+ String errText ,
95
+ boolean bStack ) {
96
96
String id = "" ;
97
97
if (o != null )
98
98
id = o .toString ();
@@ -123,7 +123,7 @@ static String getErrString(String errCode) {
123
123
124
124
/**
125
125
* Make a new SQLException
126
- *
126
+ *
127
127
* @param errText
128
128
* the excception message
129
129
* @param errState
@@ -133,43 +133,43 @@ static String getErrString(String errCode) {
133
133
* The exception that caused this exception
134
134
*/
135
135
public SQLServerException (String errText ,
136
- SQLState sqlState ,
137
- DriverError driverError ,
138
- Throwable cause ) {
136
+ SQLState sqlState ,
137
+ DriverError driverError ,
138
+ Throwable cause ) {
139
139
this (errText , sqlState .getSQLStateCode (), driverError .getErrorCode (), cause );
140
140
}
141
141
142
142
public SQLServerException (String errText ,
143
- String errState ,
144
- int errNum ,
145
- Throwable cause ) {
143
+ String errState ,
144
+ int errNum ,
145
+ Throwable cause ) {
146
146
super (errText , errState , errNum );
147
147
initCause (cause );
148
148
logException (null , errText , true );
149
149
ActivityCorrelator .setCurrentActivityIdSentFlag (); // set the activityid flag so that we don't send the current ActivityId later.
150
150
}
151
151
152
152
public SQLServerException (String errText ,
153
- Throwable cause ) {
153
+ Throwable cause ) {
154
154
super (errText );
155
155
initCause (cause );
156
156
logException (null , errText , true );
157
157
ActivityCorrelator .setCurrentActivityIdSentFlag ();
158
158
}
159
159
160
160
/* L0 */ public SQLServerException (Object obj ,
161
- String errText ,
162
- String errState ,
163
- int errNum ,
164
- boolean bStack ) {
161
+ String errText ,
162
+ String errState ,
163
+ int errNum ,
164
+ boolean bStack ) {
165
165
super (errText , errState , errNum );
166
166
logException (obj , errText , bStack );
167
167
ActivityCorrelator .setCurrentActivityIdSentFlag ();
168
168
}
169
169
170
170
/**
171
171
* Make a new SQLException
172
- *
172
+ *
173
173
* @param obj
174
174
* @param errText
175
175
* the exception message
@@ -181,10 +181,10 @@ public SQLServerException(String errText,
181
181
* true to generate the stack trace
182
182
*/
183
183
/* L0 */ public SQLServerException (Object obj ,
184
- String errText ,
185
- String errState ,
186
- StreamError streamError ,
187
- boolean bStack ) {
184
+ String errText ,
185
+ String errState ,
186
+ StreamError streamError ,
187
+ boolean bStack ) {
188
188
super (errText , errState , streamError .getErrorNumber ());
189
189
190
190
// Log SQL error with info from StreamError.
@@ -195,7 +195,7 @@ public SQLServerException(String errText,
195
195
196
196
/**
197
197
* Build a new SQL Exception from an error detected by the driver.
198
- *
198
+ *
199
199
* @param con
200
200
* the connection
201
201
* @param obj
@@ -208,10 +208,10 @@ public SQLServerException(String errText,
208
208
* @throws SQLServerException
209
209
*/
210
210
/* L0 */ static void makeFromDriverError (SQLServerConnection con ,
211
- Object obj ,
212
- String errText ,
213
- String state ,
214
- boolean bStack ) throws SQLServerException {
211
+ Object obj ,
212
+ String errText ,
213
+ String state ,
214
+ boolean bStack ) throws SQLServerException {
215
215
// The sql error code is 0 since the error was not returned from the database
216
216
// The state code is supplied by the calling code as XOPEN compliant.
217
217
// XOPEN is used as the primary code here since they are published free
@@ -237,7 +237,7 @@ public SQLServerException(String errText,
237
237
238
238
/**
239
239
* Build a new SQL Exception from a streamError detected by the driver.
240
- *
240
+ *
241
241
* @param con
242
242
* the connection
243
243
* @param obj
@@ -249,10 +249,10 @@ public SQLServerException(String errText,
249
249
* @throws SQLServerException
250
250
*/
251
251
/* L0 */ static void makeFromDatabaseError (SQLServerConnection con ,
252
- Object obj ,
253
- String errText ,
254
- StreamError streamError ,
255
- boolean bStack ) throws SQLServerException {
252
+ Object obj ,
253
+ String errText ,
254
+ StreamError streamError ,
255
+ boolean bStack ) throws SQLServerException {
256
256
String state = generateStateCode (con , streamError .getErrorNumber (), streamError .getErrorState ());
257
257
258
258
SQLServerException theException = new SQLServerException (obj , SQLServerException .checkAndAppendClientConnId (errText , con ), state , streamError ,
@@ -270,9 +270,9 @@ public SQLServerException(String errText,
270
270
271
271
// This code is same as the conversion logic that previously existed in connecthelper.
272
272
static void ConvertConnectExceptionToSQLServerException (String hostName ,
273
- int portNumber ,
274
- SQLServerConnection conn ,
275
- Exception ex ) throws SQLServerException {
273
+ int portNumber ,
274
+ SQLServerConnection conn ,
275
+ Exception ex ) throws SQLServerException {
276
276
Exception connectException = ex ;
277
277
// Throw the exception if exception was caught by code above (stored in connectException).
278
278
if (connectException != null ) {
@@ -287,7 +287,7 @@ static void ConvertConnectExceptionToSQLServerException(String hostName,
287
287
288
288
/**
289
289
* Map XOPEN states.
290
- *
290
+ *
291
291
* @param state
292
292
* the state
293
293
* @return the mapped state
@@ -316,7 +316,7 @@ static void ConvertConnectExceptionToSQLServerException(String hostName,
316
316
317
317
/**
318
318
* Generate the JDBC state code based on the error number returned from the database
319
- *
319
+ *
320
320
* @param con
321
321
* the connection
322
322
* @param errNum
@@ -326,8 +326,8 @@ static void ConvertConnectExceptionToSQLServerException(String hostName,
326
326
* @return the state code
327
327
*/
328
328
/* L0 */ static String generateStateCode (SQLServerConnection con ,
329
- int errNum ,
330
- int databaseState ) {
329
+ int errNum ,
330
+ int databaseState ) {
331
331
// Generate a SQL 99 or XOPEN state from a database generated error code
332
332
boolean xopenStates = (con != null && con .xopenStates );
333
333
if (xopenStates ) {
@@ -372,15 +372,15 @@ static void ConvertConnectExceptionToSQLServerException(String hostName,
372
372
373
373
/**
374
374
* Append ClientConnectionId to an error message if applicable
375
- *
375
+ *
376
376
* @param errMsg
377
377
* - the orginal error message.
378
378
* @param conn
379
379
* - the SQLServerConnection object
380
380
* @return error string concated by ClientConnectionId(in string format) if applicable, otherwise, return original error string.
381
381
*/
382
382
static String checkAndAppendClientConnId (String errMsg ,
383
- SQLServerConnection conn ) throws SQLServerException {
383
+ SQLServerConnection conn ) throws SQLServerException {
384
384
if (null != conn && conn .attachConnId ()) {
385
385
UUID clientConnId = conn .getClientConIdInternal ();
386
386
assert null != clientConnId ;
0 commit comments