Hibernate version:2.1.2
Mapping documents:
<property
column="COLUMN_NAME"
name="alias"
not-null="false"
type="MyCustomedType"
/>
Name and version of the database you are using: oracle 9.2.0.1
I create a class named MyCustomedType which implemented the interface of UserType, and the relative mapping part is shown above.
I try to use MyCustomedType as follow:
Code:
StringClobType oct = new StringClobType();
DriverManager.registerDriver(new OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@server_name:1521:SID", username, password);
oct.nullSafeSet(conn.prepareStatement("select * from table_name"), value, index);
Though it works, I don't think that follows the implementation of the interface, since it goes back to SQL.
Plz tell me the right way, thanks lot and lot!
And, sorry for my bad English!