1 17 18 21 package org.quartz.impl.jdbcjobstore; 22 23 import java.io.IOException ; 24 import java.io.InputStream ; 25 import java.io.ObjectInputStream ; 26 import java.sql.ResultSet ; 27 import java.sql.SQLException ; 28 29 import org.apache.commons.logging.Log; 30 31 38 public class MSSQLDelegate extends StdJDBCDelegate { 39 49 public MSSQLDelegate(Log log, String tablePrefix, String instanceId) { 50 super(log, tablePrefix, instanceId); 51 } 52 53 public MSSQLDelegate(Log log, String tablePrefix, String instanceId, Boolean useProperties) { 54 super(log, tablePrefix, instanceId, useProperties); 55 } 56 57 61 78 protected Object getObjectFromBlob(ResultSet rs, String colName) 79 throws ClassNotFoundException , IOException , SQLException { 80 InputStream binaryInput = rs.getBinaryStream(colName); 81 82 if(binaryInput == null) { 83 return null; 84 } 85 86 Object obj = null; 87 88 ObjectInputStream in = new ObjectInputStream (binaryInput); 89 try { 90 obj = in.readObject(); 91 } finally { 92 in.close(); 93 } 94 95 return obj; 96 } 97 98 protected Object getJobDetailFromBlob(ResultSet rs, String colName) 99 throws ClassNotFoundException , IOException , SQLException { 100 if (canUseProperties()) { 101 InputStream binaryInput = rs.getBinaryStream(colName); 102 return binaryInput; 103 } 104 return getObjectFromBlob(rs, colName); 105 } 106 } 107 108 | Popular Tags |