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 39 public class HSQLDBDelegate extends StdJDBCDelegate { 40 50 public HSQLDBDelegate(Log log, String tablePrefix, String instanceId) { 51 super(log, tablePrefix, instanceId); 52 } 53 54 66 public HSQLDBDelegate(Log log, String tablePrefix, String instanceId, 67 Boolean useProperties) { 68 super(log, tablePrefix, instanceId, useProperties); 69 } 70 71 75 92 protected Object getObjectFromBlob(ResultSet rs, String colName) 93 throws ClassNotFoundException , IOException , SQLException { 94 InputStream binaryInput = rs.getBinaryStream(colName); 95 96 if(binaryInput == null) { 97 return null; 98 } 99 100 Object obj = null; 101 102 ObjectInputStream in = new ObjectInputStream (binaryInput); 103 try { 104 obj = in.readObject(); 105 } finally { 106 in.close(); 107 } 108 109 return obj; 110 } 111 112 protected Object getJobDetailFromBlob(ResultSet rs, String colName) 113 throws ClassNotFoundException , IOException , SQLException { 114 if (canUseProperties()) { 115 InputStream binaryInput = rs.getBinaryStream(colName); 116 return binaryInput; 117 } 118 return getObjectFromBlob(rs, colName); 119 } 120 } 121 122 | Popular Tags |