use of java.sql.SQLClientInfoException in project jdk8u_jdk by JetBrains.
the class SQLClientInfoExceptionTests method test1.
/**
* Create SQLClientInfoException with no-arg constructor
*/
@Test
public void test1() {
SQLClientInfoException ex = new SQLClientInfoException();
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0 && ex.getFailedProperties() == null);
}
use of java.sql.SQLClientInfoException in project jdk8u_jdk by JetBrains.
the class SQLClientInfoExceptionTests method test5.
/**
* Create SQLClientInfoException with message, and SQLState
*/
@Test
public void test5() {
SQLClientInfoException ex = new SQLClientInfoException(reason, state, map);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == 0 && ex.getFailedProperties().equals(map));
}
use of java.sql.SQLClientInfoException in project tomcat by apache.
the class DelegatingConnection method setClientInfo.
@Override
public void setClientInfo(final String name, final String value) throws SQLClientInfoException {
try {
checkOpen();
_conn.setClientInfo(name, value);
} catch (final SQLClientInfoException e) {
throw e;
} catch (final SQLException e) {
throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e);
}
}
use of java.sql.SQLClientInfoException in project jdbc-shards by wplatform.
the class JdbcConnection method getClientInfo.
/**
* Get a client property.
*
* @param name the client info name (ignored)
* @return the property value
*/
@Override
public String getClientInfo(String name) throws SQLException {
try {
if (isDebugEnabled()) {
debugCodeCall("getClientInfo", name);
}
checkClosed();
Properties p = getClientInfo();
String s = p.getProperty(name);
if (s == null) {
throw new SQLClientInfoException();
}
return s;
} catch (Exception e) {
throw logAndConvert(e);
}
}
use of java.sql.SQLClientInfoException in project jdk8u_jdk by JetBrains.
the class SQLClientInfoExceptionTests method test2.
/**
* Create SQLClientInfoException with null Throwable
*/
@Test
public void test2() {
SQLClientInfoException ex = new SQLClientInfoException(map, null);
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0 && ex.getFailedProperties().equals(map));
}
Aggregations