You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a nullpointer when using the inet-type on postgres 10/jdbc-4.2.1.4
Caused by: java.lang.NullPointerException
at org.postgresql.jdbc.TypeInfoCache.getOidStatement(TypeInfoCache.java:256)
Updating the method nullSafeSet to:
@Override
public void nullSafeSet(PreparedStatement preparedStatement, Object o, int i, SessionImplementor sessionImplementor) throws HibernateException, SQLException {
if (o == null) {
preparedStatement.setNull(i, java.sql.Types.OTHER);
} else {
PGobject object = new PGobject();
object.setValue(((InetAddress) o).getHostAddress());
**object.setType("inet");**
preparedStatement.setObject(i, object);
}
}
Fixes the problem
The text was updated successfully, but these errors were encountered:
I get a nullpointer when using the inet-type on postgres 10/jdbc-4.2.1.4
Caused by: java.lang.NullPointerException
at org.postgresql.jdbc.TypeInfoCache.getOidStatement(TypeInfoCache.java:256)
Updating the method nullSafeSet to:
Fixes the problem
The text was updated successfully, but these errors were encountered: