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 javax.jdo.JDOFatalDataStoreException; import java.sql.PreparedStatement ; 21 import java.sql.SQLException ; 22 import java.sql.ResultSet ; 23 import java.io.File ; 24 25 31 public class FileConverter extends TypeAsStringConverterBase { 32 33 public static class Factory extends NoArgJdbcConverterFactory { 34 35 private FileConverter converter; 36 37 41 public JdbcConverter createJdbcConverter(JdbcColumn col, Object args, 42 JdbcTypeRegistry jdbcTypeRegistry) { 43 if (converter == null) converter = new FileConverter(); 44 return converter; 45 } 46 47 } 48 49 53 protected Object fromString(String s) { 54 return new File (s); 55 } 56 57 61 public Class getValueType() { 62 return File .class; 63 } 64 65 } 66 67 | Popular Tags |