项目:ProyectoPacientes
文件:JDBC4ConnectionWrapper.java
public void setClientInfo(String name,String value) throws sqlClientInfoException {
try {
checkClosed();
((java.sql.Connection) this.mc).setClientInfo(name,value);
} catch (sqlException sqlException) {
try {
checkAndFireConnectionError(sqlException);
} catch (sqlException sqlEx2) {
sqlClientInfoException clientEx = new sqlClientInfoException();
clientEx.initCause(sqlEx2);
throw clientEx;
}
}
}
项目:the-vigilantes
文件:JDBC4ConnectionWrapper.java
public void setClientInfo(Properties properties) throws sqlClientInfoException {
try {
checkClosed();
((java.sql.Connection) this.mc).setClientInfo(properties);
} catch (sqlException sqlException) {
try {
checkAndFireConnectionError(sqlException);
} catch (sqlException sqlEx2) {
sqlClientInfoException clientEx = new sqlClientInfoException();
clientEx.initCause(sqlEx2);
throw clientEx;
}
}
}
项目:the-vigilantes
文件:JDBC4ConnectionWrapper.java
/**
* Validate that the ordering of the returned Exceptions is correct using
* for-each loop
*/
@Test
public void test11() {
sqlClientInfoException ex = new sqlClientInfoException("Exception 1",map,t1);
sqlClientInfoException ex1 = new sqlClientInfoException("Exception 2",map);
sqlClientInfoException ex2 = new sqlClientInfoException("Exception 3",t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
for (Throwable e : ex) {
assertTrue(msgs[num++].equals(e.getMessage()));
}
}
项目:BibliotecaPS
文件:JDBC4ConnectionWrapper.java
项目:OpenVertretung
文件:JDBC4ConnectionWrapper.java
项目:ProyectoPacientes
文件:JDBC4ClientInfoProviderSP.java
public synchronized void setClientInfo(java.sql.Connection conn,Properties properties) throws sqlClientInfoException {
try {
Enumeration<?> propNames = properties.propertyNames();
while (propNames.hasMoreElements()) {
String name = (String) propNames.nextElement();
String value = properties.getProperty(name);
setClientInfo(conn,name,value);
}
} catch (sqlException sqlEx) {
sqlClientInfoException clientInfoEx = new sqlClientInfoException();
clientInfoEx.initCause(sqlEx);
throw clientInfoEx;
}
}
项目:BibliotecaPS
文件:JDBC4ConnectionWrapper.java
public void setClientInfo(Properties properties) throws sqlClientInfoException {
try {
checkClosed();
((java.sql.Connection) this.mc).setClientInfo(properties);
} catch (sqlException sqlException) {
try {
checkAndFireConnectionError(sqlException);
} catch (sqlException sqlEx2) {
sqlClientInfoException clientEx = new sqlClientInfoException();
clientEx.initCause(sqlEx2);
throw clientEx;
}
}
}
项目:lams
文件:JDBC4ConnectionWrapper.java
项目:dremio-oss
文件:Drill2489CallsAfterCloseThrowExceptionsTest.java
@Override
protected boolean isOkaySpecialCaseException(Method method,Throwable cause) {
final boolean result;
if (super.isOkaySpecialCaseException(method,cause)) {
result = true;
}
else if (sqlClientInfoException.class == cause.getClass()
&& normalClosedExceptionText.equals(cause.getMessage())
&& (false
|| method.getName().equals("setClientInfo")
|| method.getName().equals("getClientInfo")
)) {
// Special good case--we had to use sqlClientInfoException from those.
result = true;
}
else if (RuntimeException.class == cause.getClass()
&& normalClosedExceptionText.equals(cause.getMessage())
&& (false
|| method.getName().equals("getCatalog")
|| method.getName().equals("getSchema")
)) {
// Special good-enough case--we had to use RuntimeException for Now.
result = true;
}
else {
result = false;
}
return result;
}
/**
* Serialize a sqlClientInfoException and make sure you can read it back
* properly
*/
@Test
public void test10() throws Exception {
sqlClientInfoException e = new sqlClientInfoException(reason,state,errorCode,t);
sqlClientInfoException ex1 =
createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage())
&& ex1.getsqlState().equals(state)
&& cause.equals(ex1.getCause().toString())
&& ex1.getErrorCode() == errorCode
&& ex1.getFailedProperties().equals(map));
}
/**
* Create sqlClientInfoException with message,sqlState,and error code
*/
@Test
public void test8() {
sqlClientInfoException ex = new sqlClientInfoException(reason,t);
assertTrue(ex.getMessage().equals(reason)
&& ex.getsqlState().equals(state)
&& cause.equals(ex.getCause().toString())
&& ex.getErrorCode() == errorCode
&& ex.getFailedProperties().equals(map));
}
/**
* Create sqlClientInfoException with message,and
* Throwable
*/
@Test
public void test7() {
sqlClientInfoException ex = new sqlClientInfoException(reason,map);
assertTrue(ex.getMessage().equals(reason)
&& ex.getsqlState().equals(state)
&& ex.getCause() == null
&& ex.getErrorCode() == errorCode
&& ex.getFailedProperties().equals(map));
}
/**
* Create sqlClientInfoException with null Throwable
*/
@Test
public void test4() {
sqlClientInfoException ex = new sqlClientInfoException(reason,null);
assertTrue(ex.getMessage().equals(reason)
&& ex.getsqlState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getFailedProperties().equals(map));
}
/**
* Create sqlClientInfoException with message
*/
@Test
public void test3() {
sqlClientInfoException ex = new sqlClientInfoException(reason,map);
assertTrue(ex.getMessage().equals(reason)
&& ex.getsqlState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getFailedProperties().equals(map));
}
项目:dswork.jdbc
文件:ConnectionSpy.java
/**
* Serialize a sqlClientInfoException and make sure you can read it back
* properly
*/
@Test
public void test10() throws Exception {
sqlClientInfoException e = new sqlClientInfoException(reason,t);
sqlClientInfoException ex1 =
createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage())
&& ex1.getsqlState().equals(state)
&& cause.equals(ex1.getCause().toString())
&& ex1.getErrorCode() == errorCode
&& ex1.getFailedProperties().equals(map));
}
项目:OpenVertretung
文件:JDBC4Connection.java
public void setClientInfo(Properties properties) throws sqlClientInfoException {
try {
getClientInfoProviderImpl().setClientInfo(this,properties);
} catch (sqlClientInfoException ciEx) {
throw ciEx;
} catch (sqlException sqlEx) {
sqlClientInfoException clientInfoEx = new sqlClientInfoException();
clientInfoEx.initCause(sqlEx);
throw clientInfoEx;
}
}
/**
* Create sqlClientInfoException with message,and sqlState
*/
@Test
public void test5() {
sqlClientInfoException ex = new sqlClientInfoException(reason,map);
assertTrue(ex.getMessage().equals(reason)
&& ex.getsqlState().equals(state)
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getFailedProperties().equals(map));
}
/**
* Create sqlClientInfoException with message
*/
@Test
public void test3() {
sqlClientInfoException ex = new sqlClientInfoException(reason,map);
assertTrue(ex.getMessage().equals(reason)
&& ex.getsqlState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0
&& ex.getFailedProperties().equals(map));
}
项目:ProyectoPacientes
文件:JDBC4Connection.java
public void setClientInfo(String name,String value) throws sqlClientInfoException {
try {
getClientInfoProviderImpl().setClientInfo(this,value);
} catch (sqlClientInfoException ciEx) {
throw ciEx;
} catch (sqlException sqlEx) {
sqlClientInfoException clientInfoEx = new sqlClientInfoException();
clientInfoEx.initCause(sqlEx);
throw clientInfoEx;
}
}
/**
* Create sqlClientInfoException with message,and sqlState
*/
@Test
public void test6() {
sqlClientInfoException ex = new sqlClientInfoException(reason,t);
assertTrue(ex.getMessage().equals(reason)
&& ex.getsqlState().equals(state)
&& cause.equals(ex.getCause().toString())
&& ex.getErrorCode() == 0
&& ex.getFailedProperties().equals(map));
}
项目:dswork.jdbc
文件:ConnectionSpy.java
项目:lams
文件:JDBC4Connection.java
public void setClientInfo(Properties properties) throws sqlClientInfoException {
try {
getClientInfoProviderImpl().setClientInfo(this,properties);
} catch (sqlClientInfoException ciEx) {
throw ciEx;
} catch (sqlException sqlEx) {
sqlClientInfoException clientInfoEx = new sqlClientInfoException();
clientInfoEx.initCause(sqlEx);
throw clientInfoEx;
}
}
/**
* Create sqlClientInfoException and setting all objects to null
*/
@Test
public void test() {
sqlClientInfoException e = new sqlClientInfoException(null);
assertTrue(e.getMessage() == null && e.getsqlState() == null
&& e.getCause() == null && e.getErrorCode() == 0
&& e.getFailedProperties() == null);
}
项目:dswork
文件:ConnectionSpy.java
@Override
public JDBCException convert(sqlException sqlException,String message,String sql) {
if ( sqlClientInfoException.class.isinstance( sqlException )
|| sqlInvalidAuthorizationSpecException.class.isinstance( sqlException )
|| sqlNonTransientConnectionException.class.isinstance( sqlException )
|| sqlTransientConnectionException.class.isinstance( sqlException ) ) {
return new JDBCConnectionException( message,sqlException,sql );
}
else if ( DataTruncation.class.isinstance( sqlException ) ||
sqlDataException.class.isinstance( sqlException ) ) {
throw new DataException( message,sql );
}
else if ( sqlIntegrityConstraintViolationException.class.isinstance( sqlException ) ) {
return new ConstraintViolationException(
message,sql,getConversionContext().getViolatedConstraintNameExtracter().extractConstraintName( sqlException )
);
}
else if ( sqlSyntaxErrorException.class.isinstance( sqlException ) ) {
return new sqlGrammarException( message,sql );
}
else if ( sqlTimeoutException.class.isinstance( sqlException ) ) {
return new QueryTimeoutException( message,sql );
}
else if ( sqlTransactionRollbackException.class.isinstance( sqlException ) ) {
// Not 100% sure this is completely accurate. The JavaDocs for sqlTransactionRollbackException state that
// it indicates sql states starting with '40' and that those usually indicate that:
// <quote>
// the current statement was automatically rolled back by the database because of deadlock or
// other transaction serialization failures.
// </quote>
return new LockAcquisitionException( message,sql );
}
return null; // allow other delegates the chance to look
}
/**
* 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);
}
项目:iotdb-jdbc
文件:TsfileConnection.java
项目:OpenDiabetes
文件:JDBCConnection.java
/**
* Sets the value of the connection's client info properties. The
* <code>Properties</code> object contains the names and values of the client info
* properties to be set. The set of client info properties contained in
* the properties list replaces the current set of client info properties
* on the connection. If a property that is currently set on the
* connection is not present in the properties list,that property is
* cleared. Specifying an empty properties list will clear all of the
* properties on the connection. See <code>setClientInfo (String,String)</code> for
* more @R_296_4045@ion.
* <p>
* If an error occurs in setting any of the client info properties,a
* <code>sqlClientInfoException</code> is thrown. The <code>sqlClientInfoException</code>
* contains @R_296_4045@ion indicating which client info properties were not set.
* The state of the client @R_296_4045@ion is unkNown because
* some databases do not allow multiple client info properties to be set
* atomically. For those databases,one or more properties may have been
* set before the error occurred.
* <p>
*
* @param properties the list of client info properties to set
* <p>
* @see java.sql.Connection#setClientInfo(String,String) setClientInfo(String,String)
* @since JDK 1.6,HsqlDB 2.0
* <p>
* @throws sqlClientInfoException if the database server returns an error while
* setting the clientInfo values on the database server or this method
* is called on a closed connection
* <p>
*/
//#ifdef JAVA6
public void setClientInfo(
Properties properties) throws sqlClientInfoException {
if (!this.isClosed && (properties == null || properties.isEmpty())) {
return;
}
sqlClientInfoException ex = new sqlClientInfoException();
if (this.isClosed) {
ex.initCause(JDBCUtil.connectionClosedException());
} else {
ex.initCause(JDBCUtil.notSupported());
}
throw ex;
}
项目:burstcoin
文件:FilteredConnection.java
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
con.setClientInfo(properties);
}
项目:openjdk-jdk10
文件:StubConnection.java
@Override
public void setClientInfo(String name,String value) throws sqlClientInfoException {
throw new UnsupportedOperationException("Not supported yet.");
}
项目:preflex
文件:ConnectionWrapper.java
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
conn.setClientInfo(properties);
}
public void setClientInfo(String name,String value) throws sqlClientInfoException {
this.getJDBC4Connection().setClientInfo(name,value);
}
项目:pugtsdb
文件:PugConnection.java
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
connection.setClientInfo(properties);
}
项目:openjdk-jdk10
文件:StubConnection.java
@Override
public void setClientInfo(Properties properties) throws sqlClientInfoException {
throw new UnsupportedOperationException("Not supported yet.");
}
项目:mycat-src-1.6.1-RELEASE
文件:MongoConnection.java
@Override
public void setClientInfo(String name,String value)
throws sqlClientInfoException {
this._clientInfo.put(name,value);
}
public void setClientInfo(Properties properties) throws sqlClientInfoException {
this.getJDBC4Connection().setClientInfo(properties);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。