1 2 12 package com.versant.core.jdbc.sql.conv; 13 14 import com.versant.core.jdbc.JdbcConverter; 15 import com.versant.core.jdbc.JdbcConverterFactory; 16 import com.versant.core.jdbc.JdbcTypeRegistry; 17 import com.versant.core.jdbc.metadata.JdbcColumn; 18 19 import java.sql.PreparedStatement ; 20 import java.sql.SQLException ; 21 import java.sql.ResultSet ; 22 23 import javax.jdo.JDOFatalDataStoreException; 25 import org.polepos.teams.jdo.*; 26 27 import com.versant.core.common.BindingSupportImpl; 28 29 30 32 33 34 39 public class OracleBlobConverter implements JdbcConverter 40 { 41 42 public OracleBlobConverter(){ 43 VoaEdited.exception(); 44 } 45 46 public static class Factory extends NoArgJdbcConverterFactory { 47 48 private OracleBlobConverter converter; 49 50 54 public JdbcConverter createJdbcConverter(JdbcColumn col, Object args, 55 JdbcTypeRegistry jdbcTypeRegistry) { 56 if (converter == null) converter = new OracleBlobConverter(); 57 return converter; 58 } 59 60 } 61 62 private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; 63 64 70 public boolean isOracleStyleLOB() { 71 return true; 72 } 73 74 79 public String getOracleStyleLOBNotNullString() { 80 return "empty_blob()"; 81 } 82 83 88 public Object get(ResultSet rs, int index, JdbcColumn col) 89 throws SQLException , JDOFatalDataStoreException { 90 91 VoaEdited.exception(); 92 return null; 93 94 99 } 100 101 102 103 108 public void set(PreparedStatement ps, int index, JdbcColumn col, Object value) 109 throws SQLException , JDOFatalDataStoreException { 110 throw BindingSupportImpl.getInstance().fatalDatastore("set(ps..) called"); 111 } 112 113 120 public void set(PreparedStatement ps, int index, JdbcColumn col, int value) 121 throws SQLException , JDOFatalDataStoreException { 122 throw BindingSupportImpl.getInstance().fatalDatastore("set(..int) called"); 123 } 124 125 132 public void set(ResultSet rs, int index, JdbcColumn col, Object value) 133 throws SQLException , JDOFatalDataStoreException { 134 135 VoaEdited.exception(); 136 137 140 141 } 145 146 150 public Class getValueType() { 151 return byte[].class; 152 } 153 154 } 155 156 | Popular Tags |