1 19 20 package org.apache.cayenne.dba.frontbase; 21 22 import java.sql.Clob ; 23 import java.sql.PreparedStatement ; 24 import java.sql.Types ; 25 26 import org.apache.cayenne.access.types.CharType; 27 import org.apache.cayenne.util.MemoryClob; 28 29 35 class FrontBaseCharType extends CharType { 38 39 FrontBaseCharType() { 40 super(false, true); 41 } 42 43 public void setJdbcObject( 44 PreparedStatement st, 45 Object val, 46 int pos, 47 int type, 48 int precision) throws Exception { 49 50 if (type == Types.CLOB) { 51 st.setClob(pos, writeClob((String ) val)); 52 } 53 else { 54 super.setJdbcObject(st, val, pos, type, precision); 55 } 56 } 57 58 Clob writeClob(String string) { 59 return string != null ? new MemoryClob(string) : null; 60 } 61 } 62 | Popular Tags |