-
Switching Hibernate’s UUID Type Mapping per Database
JDBC doesn’t include UUIDs as one of its generic SQL types and so the different relational databases supported by Hibernate have different mechanisms to save and retrieve UUIDs. PostgreSQL’s JDBC driver, for example, requires that you use Types.OTHER as a surrogate for the missing UUID constant: preparedStatement.setObject( index, uuid, Types.OTHER ); Whereas H2 requires the…
-
Adding a MySQL datasource to JBoss AS 7
This post assumes you are using a Unix like system with a bash shell and have already downloaded and extracted the JBoss AS 7 application server. Retrieve the MySQL Connector The connector can be downloaded from: http://dev.mysql.com/downloads/connector/j/. The current version at the time of writing is 5.1.17, further sections of this guide assume that version…