Best code examples for Java 8 SQLException class (java.sql.SQLException)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SQLException class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 SQLException examples from Open Source projects
This code example shows how to use the following methods: getMessage, getErrorCode, getSQLState
45:	ex.getSQLState() + "]; error code [" + ex.getErrorCode() + "]; " + ex.getMessage(), ex); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getClass, getNextException, getSQLState
47:	 
-
117:	if (ex.getClass().getName().contains("Timeout")) { 
-
134:	String sqlState = ex.getSQLState(); 
-
136:	SQLException nestedEx = ex.getNextException(); 
-
138:	sqlState = nestedEx.getSQLState(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
15:	Assert.assertFalse(sorter.isExceptionFatal(new SQLException())); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: printStackTrace
88:	e.printStackTrace(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getMessage
101:	LOG.warn(StringUtils.stringifyException(ex)); 
-
103:	throw new IOException(e.getMessage()); 
-
110:	throw new IOException(ex.getMessage()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getMessage
46:	String errorText = (e.getMessage()).toUpperCase(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
87:	LOG.error("getNumRecords() error: " + sqlEx.getMessage(), sqlEx); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getSQLState
137:	if (!POSTGRESQL_DUPLICATE_KEY_STATE.equals(sqle.getSQLState())) { 
138:	log.warn("Exception while setting preference", sqle); 
139:	throw new TasteException(sqle); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getErrorCode
32:	if (ex.getErrorCode() == 2) { 
33:	return new TransientDataAccessResourceException("Custom", ex); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getSQLState
76:	if (!"08006".equals(ex.getSQLState())) { 
77:	LogFactory.getLog(getClass()).warn("Could not shutdown in-memory Derby database", ex); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
76:	if (e.getMessage().contains("No data is available")) { 
-
79:	} else if (e.getMessage().contains("ResultSet closed")) { 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
69:	throw new SQLException("Unknown datasource type! Was expecting BoneCPDataSource but received "+oldDS.getClass()+". Not switching datasource!"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
63:	fail("SQLException is thrown: " + e.getMessage()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
177:	expect(method.invoke(mockClass, args)).andReturn(false).once().andThrow(new SQLException()).once(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
46:	log.error("SQLServerSequenceDAO:generateSequence"+sqlEx.getMessage(),sqlEx); 
47:	throw new I2B2DAOException("SQLServerSequenceDAO:generateSequence"+sqlEx.getMessage(),sqlEx); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
119:	throw new SQLException(ex); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getSQLState
147:	if (!POSTGRESQL_DUPLICATE_KEY_STATE.equals(sqle.getSQLState())) { 
-
163:	log.warn("Exception while setting preference", sqle); 
164:	throw new TasteException(sqle); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: toString
50:	fail("Unexpected SQLException " + e.toString()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getCause, getMessage, getStackTrace, getErrorCode, getSQLState
36:	sqle.getCause() instanceof SQLException? 
37:	(sqle=(SQLException)sqle.getCause()).getMessage(): 
38:	sqle.getMessage(),"database"); 
-
92:	sqlstate=sqle.getSQLState(); 
93:	errorcode=sqle.getErrorCode(); 
-
95:	this.setStackTrace(sqle.getStackTrace()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: printStackTrace
125:	log.error("Error while building sql", ex); 
126:	throw new I2B2DAOException("Error while building sql ", ex); 
-
131:	e.printStackTrace(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMessage
64:	throw new DatabaseException("Cannot obtain a new connection (" + ex.getMessage() + ")", ex); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getMessage
41:	fail( e.getMessage() ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
20:	SQLException sqlException = new SQLException("DB error", runtimeException); 
21:	sqlExceptionMapper.logException(4981, sqlException); 
-
23:	verify(logger).error("Error handling a request: 0000000000001375", sqlException); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
242:	expectLastCall().andThrow(new SQLException()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: printStackTrace
85:	e.printStackTrace(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
77:	Logger.log(e, "Database Error while processing a ResultSet"); 
78:	throw new ServerException("Database Error : An error occured during processing : " + e.getMessage(), e); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
195:	return new SQLException(PoolUtil.stringifyException(t)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMessage
90:	throw new IOException(ex.getMessage()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getMessage
77:	Logger.log(e, "Database Error while processing a ResultSet"); 
78:	throw new ServerException("Database Error : An error occured during processing : " + e.getMessage(), e); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMessage
42:	throw new FieldContextException("Error in getting attributes from RDBMS Struct: " + 
43:	e.getMessage(), e); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: printStackTrace
24:	e.printStackTrace(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
367:	expectLastCall().andThrow(new SQLException()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMessage
54:	log.error(e.getMessage(), e); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
239:	throw new SQLException("Not a simple type. (" + typeName + ")"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMessage
166:	throw new IOException(e.getMessage()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
56:	DataAccessException exFor2 = sext.doTranslate("", "", new SQLException("Ouch", "42000", 2)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: printStackTrace
32:	e.printStackTrace(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
84:	SQLException ex = new SQLException(REASON, sqlState); 
-
86:	DataAccessException dax = translator.translate(TASK, SQL, ex); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: printStackTrace
30:	e.printStackTrace(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMessage
62:	throw new DatabaseException("Cannot obtain a new connection (" + ex.getMessage() + ")", ex); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: printStackTrace
26:	e.printStackTrace(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
209:	given(rsetMethod.invoke(rset, arg)).willReturn(ret).willThrow(new SQLException("test")); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getMessage
188:	LOG.warn("Error executing query : " + query  + " Exception=" + e.getMessage() ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: printStackTrace
62:	e.printStackTrace(); 
Full Snippet Info
6
CodeRank
Related Java 8 SQLException Questions & Answers:
See Code Examples for Java 8 SQLException Methods: