01: /*
02: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: [See end of file]
04: $Id: DBBlob.java,v 1.10 2008/01/02 12:08:23 andy_seaborne Exp $
05: */
06:
07: package com.hp.hpl.jena.db.impl;
08:
09: import java.sql.Blob;
10:
11: import com.hp.hpl.jena.db.RDFRDBException;
12:
13: /**
14: * @author hkuno
15: *
16: * To change the template for this generated type comment go to
17: * Window>Preferences>Java>Code Generation>Code and Comments
18: */
19: public abstract class DBBlob implements IDBBlob {
20:
21: // NOT CURRENTLY USED (Jena 2.4)
22:
23: /** the real blob */
24: protected Object m_blob;
25:
26: /** the target database type */
27: protected String m_dbtype;
28:
29: /** constructor */
30: public DBBlob(Object ablob, String dbType) {
31: m_dbtype = dbType;
32: m_blob = ablob;
33:
34: }
35:
36: public DBBlob() {
37: }
38:
39: /**
40: TODO is this obsolete? It doesn't look useful and it's never called.
41: * Creates and returns instance of appropriate subclass of DBBlob.
42: * @param ablob
43: * @param dbType
44: * @return null ?
45: */
46: public static IDBBlob getDBBlob(Object ablob, String dbType) {
47: IDBBlob result = null;
48: if (dbType.equalsIgnoreCase("oracle")) {
49: // result = new DBBlob_Oracle(ablob, dbType);
50: } else {
51: throw new RDFRDBException(
52: "No appropriate blob type found for " + dbType);
53: }
54: return (result);
55:
56: }
57:
58: /* (non-Javadoc)
59: * @see com.hp.hpl.jena.db.impl.IDBBlob#asOracleBlob()
60: */
61: public Blob getBlob() {
62: // TODO Auto-generated method stub
63: return ((java.sql.Blob) m_blob);
64: }
65:
66: }
67: /*
68: (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
69: All rights reserved.
70:
71: Redistribution and use in source and binary forms, with or without
72: modification, are permitted provided that the following conditions
73: are met:
74:
75: 1. Redistributions of source code must retain the above copyright
76: notice, this list of conditions and the following disclaimer.
77:
78: 2. Redistributions in binary form must reproduce the above copyright
79: notice, this list of conditions and the following disclaimer in the
80: documentation and/or other materials provided with the distribution.
81:
82: 3. The name of the author may not be used to endorse or promote products
83: derived from this software without specific prior written permission.
84:
85: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
86: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
87: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
88: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
89: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
90: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
91: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
92: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
93: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
94: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95: */
|