Source Code Cross Referenced for Ref.java in  » 6.0-JDK-Core » sql » java » sql » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » sql » java.sql 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1998-2006 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.sql;
027
028        /**
029         * The mapping in the Java programming language of an SQL <code>REF</code>
030         * value, which is a reference to an SQL structured type value in the database.
031         * <P>
032         * SQL <code>REF</code> values are stored in a table that contains
033         * instances of a referenceable SQL structured type, and each <code>REF</code>
034         * value is a unique identifier for one instance in that table. 
035         * An SQL <code>REF</code> value may be used in place of the
036         * SQL structured type it references, either as a column value in a
037         * table or an attribute value in a structured type.
038         * <P>
039         * Because an SQL <code>REF</code> value is a logical pointer to an
040         * SQL structured type, a <code>Ref</code> object is by default also a logical
041         * pointer. Thus, retrieving an SQL <code>REF</code> value as
042         * a <code>Ref</code> object does not materialize
043         * the attributes of the structured type on the client.
044         * <P>
045         * A <code>Ref</code> object can be stored in the database using the 
046         * <code>PreparedStatement.setRef</code> method.
047         * <p>
048         * All methods on the <code>Ref</code> interface must be fully implemented if the 
049         * JDBC driver supports the data type.
050         * 
051         * @see Struct
052         * @since 1.2
053         */
054        public interface Ref {
055
056            /**
057             * Retrieves the fully-qualified SQL name of the SQL structured type that
058             * this <code>Ref</code> object references.
059             * 
060             * @return the fully-qualified SQL name of the referenced SQL structured type 
061             * @exception SQLException if a database access error occurs
062             * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
063             * this method
064             * @since 1.2
065             */
066            String getBaseTypeName() throws SQLException;
067
068            /**
069             * Retrieves the referenced object and maps it to a Java type
070             * using the given type map.
071             *
072             * @param map a <code>java.util.Map</code> object that contains 
073             *        the mapping to use (the fully-qualified name of the SQL
074             *        structured type being referenced and the class object for
075             *        <code>SQLData</code> implementation to which the SQL
076             *        structured type will be mapped)
077             * @return  a Java <code>Object</code> that is the custom mapping for 
078             *          the SQL structured type to which this <code>Ref</code>
079             *          object refers
080             * @exception SQLException if a database access error occurs
081             * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
082             * this method
083             * @since 1.4
084             * @see #setObject
085             */
086            Object getObject(java.util.Map<String, Class<?>> map)
087                    throws SQLException;
088
089            /**
090             * Retrieves the SQL structured type instance referenced by
091             * this <code>Ref</code> object.  If the connection's type map has an entry
092             * for the structured type, the instance will be custom mapped to
093             * the Java class indicated in the type map.  Otherwise, the
094             * structured type instance will be mapped to a <code>Struct</code> object.
095             *
096             * @return  a Java <code>Object</code> that is the mapping for 
097             *          the SQL structured type to which this <code>Ref</code>
098             *          object refers
099             * @exception SQLException if a database access error occurs
100             * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
101             * this method
102             * @since 1.4
103             * @see #setObject
104             */
105            Object getObject() throws SQLException;
106
107            /**
108             * Sets the structured type value that this <code>Ref</code>
109             * object references to the given instance of <code>Object</code>.
110             * The driver converts this to an SQL structured type when it
111             * sends it to the database.
112             *
113             * @param value an <code>Object</code> representing the SQL 
114             *        structured type instance that this
115             *        <code>Ref</code> object will reference
116             * @exception SQLException if a database access error occurs
117             * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
118             * this method
119             * @since 1.4
120             * @see #getObject()
121             * @see #getObject(Map)
122             * @see PreparedStatement#setObject(int, Object)
123             * @see CallableStatement#setObject(String, Object)
124             */
125            void setObject(Object value) throws SQLException;
126
127        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.