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.Blob ; 27 import java.sql.ResultSet ; 28 import java.sql.SQLException ; 29 30 import org.apache.commons.logging.Log; 31 32 40 public class WebLogicDelegate extends StdJDBCDelegate { 41 51 public WebLogicDelegate(Log log, String tablePrefix, String instanceId) { 52 super(log, tablePrefix, instanceId); 53 } 54 55 67 public WebLogicDelegate(Log log, String tablePrefix, String instanceId, 68 Boolean useProperties) { 69 super(log, tablePrefix, instanceId, useProperties); 70 } 71 72 76 93 protected Object getObjectFromBlob(ResultSet rs, String colName) 94 throws ClassNotFoundException , IOException , SQLException { 95 96 Object obj = null; 97 98 Blob blobLocator = rs.getBlob(colName); 99 InputStream binaryInput = null; 100 try { 101 if (null != blobLocator && blobLocator.length() > 0) { 102 binaryInput = blobLocator.getBinaryStream(); 103 } 104 } catch (Exception ignore) { 105 } 106 107 if (null != binaryInput) { 108 ObjectInputStream in = new ObjectInputStream (binaryInput); 109 try { 110 obj = in.readObject(); 111 } finally { 112 in.close(); 113 } 114 } 115 116 return obj; 117 } 118 119 protected Object getJobDetailFromBlob(ResultSet rs, String colName) 120 throws ClassNotFoundException , IOException , SQLException { 121 122 if (canUseProperties()) { 123 Blob blobLocator = rs.getBlob(colName); 124 InputStream binaryInput = null; 125 try { 126 if (null != blobLocator && blobLocator.length() > 0) { 127 binaryInput = blobLocator.getBinaryStream(); 128 } 129 } catch (Exception ignore) { 130 } 131 return binaryInput; 132 } 133 134 return getObjectFromBlob(rs, colName); 135 } 136 } 137 138 | Popular Tags |