KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > db > impl > DBBlob


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: DBBlob.java,v 1.6 2005/02/21 12:02:41 andy_seaborne Exp $
5 */

6
7 package com.hp.hpl.jena.db.impl;
8
9 import java.sql.Blob JavaDoc;
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     /** the real blob */
22     protected Object JavaDoc m_blob;
23     
24     
25     /** the target database type */
26     protected String JavaDoc m_dbtype;
27
28     /** constructor */
29     public DBBlob(Object JavaDoc ablob, String JavaDoc dbType) {
30             m_dbtype = dbType;
31             m_blob = ablob;
32             
33     }
34     
35     public DBBlob() {
36     }
37     
38     /**
39      TODO is this obsolete? It doesn't look useful and it's never called.
40      * Creates and returns instance of appropriate subclass of DBBlob.
41      * @param ablob
42      * @param dbType
43      * @return null ?
44      */

45     public static IDBBlob getDBBlob(Object JavaDoc ablob, String JavaDoc dbType) {
46         IDBBlob result = null;
47         if (dbType.equalsIgnoreCase("oracle")) {
48             // result = new DBBlob_Oracle(ablob, dbType);
49
} else {
50             throw new RDFRDBException("No appropriate blob type found for " + dbType);
51         }
52         return (result);
53         
54     
55     }
56     
57
58     /* (non-Javadoc)
59      * @see com.hp.hpl.jena.db.impl.IDBBlob#asOracleBlob()
60      */

61     public Blob JavaDoc getBlob() {
62         // TODO Auto-generated method stub
63
return ((java.sql.Blob JavaDoc) m_blob);
64     }
65
66 }
67 /*
68     (c) Copyright 2002, 2003, 2004, 2005 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 */

96
Popular Tags