API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.sql.rowset.serial. SerialDatalink View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

/*
 * @(#)SerialDatalink.java	1.6 05/11/17
 *
 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package javax.sql.rowset.serial;

import java.sql.*;
import java.io.*;
import java.net.URL;


/**
 * A serialized mapping in the Java programming language of an SQL 
 * <code>DATALINK</code> value. A <code>DATALINK</code> value 
 * references a file outside of the underlying data source that the
 * data source manages.
 * <P>
 * <code>RowSet</code> implementations can use the method <code>RowSet.getURL</code>
 * to retrieve a <code>java.net.URL</code> object, which can be used
 * to manipulate the external data.
 * <pre>
 *      java.net.URL url = rowset.getURL(1);
 * </pre>
 */
public class SerialDatalink implements Serializable, Cloneable {

    /**
     * The extracted URL field retrieved from the DATALINK field.
     * @serial
     */
    private URL url;

    /**
     * The SQL type of the elements in this <code>SerialDatalink</code> 
     * object.  The type is expressed as one of the contants from the
     * class <code>java.sql.Types</code>.
     * @serial
     */
    private int baseType;

    /**
     * The type name used by the DBMS for the elements in the SQL 
     * <code>DATALINK</code> value that this SerialDatalink object
     * represents.
     * @serial
     */
    private String baseTypeName;

    /**
      * Constructs a new <code>SerialDatalink</code> object from the given
      * <code>java.net.URL</code> object.
      * <P>
      * @throws SerialException if url parameter is a null
      */
    public SerialDatalink(URL url) throws SerialException {
	if (url == null) {
	    throw new SerialException("Cannot serialize empty URL instance");
	}
	this.url = url;
    }

    /**
     * Returns a new URL that is a copy of this <code>SerialDatalink</code> 
     * object. 
     *
     * @return a copy of this <code>SerialDatalink</code> object as a
     * <code>URL</code> object in the Java programming language.
     * @throws SerialException if the <code>URL</code> object cannot be de-serialized
     */
    public URL getDatalink() throws SerialException {

	URL aURL = null;

	try {
	    aURL = new URL((this.url).toString());
	} catch (java.net.MalformedURLException e) {
	    throw new SerialException("MalformedURLException: " + e.getMessage());
	}
	return aURL;
    }
    

    /**
	 * The identifier that assists in the serialization of this <code>SerialDatalink</code>
     * object.
     */
    static final long serialVersionUID = 2826907821828733626L;
}

Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar