Author: steve.ebersole(a)jboss.com
Date: 2009-11-10 16:26:50 -0500 (Tue, 10 Nov 2009)
New Revision: 17951
Modified:
core/trunk/core/src/main/java/org/hibernate/engine/jdbc/ContextualLobCreator.java
Log:
HHH-4560 - JDBC4 support inadvertently missed 1.4 compatibility
Modified:
core/trunk/core/src/main/java/org/hibernate/engine/jdbc/ContextualLobCreator.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/engine/jdbc/ContextualLobCreator.java 2009-11-10
20:00:14 UTC (rev 17950)
+++
core/trunk/core/src/main/java/org/hibernate/engine/jdbc/ContextualLobCreator.java 2009-11-10
21:26:50 UTC (rev 17951)
@@ -36,6 +36,7 @@
import java.lang.reflect.InvocationTargetException;
import org.hibernate.HibernateException;
+import org.hibernate.JDBCException;
/**
* {@link LobCreator} implementation using contextual creation against the JDBC {@link
java.sql.Connection} class's LOB creation
@@ -70,7 +71,7 @@
return blob;
}
catch ( SQLException e ) {
- throw new IllegalStateException( "Unable to set BLOB bytes after creation",
e );
+ throw new JDBCException( "Unable to set BLOB bytes after creation", e );
}
}
@@ -88,10 +89,10 @@
return blob;
}
catch ( SQLException e ) {
- throw new IllegalStateException( "Unable to prepare BLOB binary stream for
writing", e );
+ throw new JDBCException( "Unable to prepare BLOB binary stream for
writing",e );
}
catch ( IOException e ) {
- throw new IllegalStateException( "Unable to write stream contents to BLOB",
e );
+ throw new HibernateException( "Unable to write stream contents to BLOB", e
);
}
}
@@ -114,7 +115,7 @@
return clob;
}
catch ( SQLException e ) {
- throw new IllegalStateException( "Unable to set CLOB string after creation",
e );
+ throw new JDBCException( "Unable to set CLOB string after creation", e );
}
}
@@ -131,10 +132,10 @@
return clob;
}
catch ( SQLException e ) {
- throw new IllegalStateException( "Unable to prepare CLOB stream for
writing", e );
+ throw new JDBCException( "Unable to prepare CLOB stream for writing", e );
}
catch ( IOException e ) {
- throw new IllegalStateException( "Unable to write CLOB stream content", e
);
+ throw new HibernateException( "Unable to write CLOB stream content", e );
}
}
@@ -157,7 +158,7 @@
return clob;
}
catch ( SQLException e ) {
- throw new IllegalStateException( "Unable to set NCLOB string after
creation", e );
+ throw new JDBCException( "Unable to set NCLOB string after creation", e );
}
}
@@ -174,10 +175,10 @@
return clob;
}
catch ( SQLException e ) {
- throw new IllegalStateException( "Unable to prepare NCLOB stream for
writing", e );
+ throw new JDBCException( "Unable to prepare NCLOB stream for writing", e );
}
catch ( IOException e ) {
- throw new IllegalStateException( "Unable to write NCLOB stream content", e
);
+ throw new HibernateException( "Unable to write NCLOB stream content", e );
}
}
@@ -216,11 +217,11 @@
}
catch ( AbstractMethodError e ) {
// this again is a big big error...
- throw new IllegalStateException( "Useable implementation of " +
creationMethod.getName() + " not found.", e );
+ throw new IllegalStateException( "Useable implementation of " +
creationMethod.getName() + " not found." );
}
catch ( IllegalAccessException e ) {
// this again is a big big error...
- throw new IllegalStateException( "Illegal access attempt on JDBC method " +
creationMethod.getName(), e );
+ throw new IllegalStateException( "Illegal access attempt on JDBC method " +
creationMethod.getName() );
}
}
}
@@ -231,7 +232,7 @@
}
catch ( NoSuchMethodException e ) {
// this is a big big error if we get here and these methods are not part of the
Connection interface...
- throw new IllegalStateException( "JDBC driver did not implement " +
methodName, e );
+ throw new IllegalStateException( "JDBC driver did not implement " +
methodName);
}
}
}
Show replies by date