1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef __com_sun_star_sdbc_XSQLData_idl__
28 #define __com_sun_star_sdbc_XSQLData_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include
<com
/sun
/star
/uno
/XInterface.idl
>
34 #ifndef __com_sun_star_sdbc_SQLException_idl__
35 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
38 module com
{ module sun
{ module star
{ module sdbc
{
40 published
interface XSQLInput
;
41 published
interface XSQLOutput
;
44 /** is used for the custom mapping of SQL user-defined types.
48 This interface must be implemented by a service that is
49 registered in a type mapping. It is expected that this interface
50 will normally be implemented by a tool. The methods in this interface
51 are called by the driver and are never called by a programmer
55 published
interface XSQLData
: com
::sun
::star
::uno
::XInterface
58 /** returns the fully-qualified name of the SQL user-defined type
59 that this object represents.
63 This method is called by the SDBC driver to get the name of the
64 UDT instance that is being mapped to this instance of SQLData.
67 the name of the SQL type.
69 if a database access error occurs.
71 string getSQLTypeName
() raises
(SQLException
);
73 //-------------------------------------------------------------------------
75 /** populates this object with data read from the database.
79 The implementation of the method must follow this protocol:
81 It must read each of the attributes or elements of the SQL
82 type from the given input stream. This is done
83 by calling a method of the input stream to read each
84 item, in the order that they appear in the SQL definition
85 of the type. The method
87 then assigns the data to appropriate fields or elements (of this
90 Specifically, it must call the appropriate
91 <code>XSQLInput.readXXX</code>
92 method(s) to do the following:
93 for a Distinct Type, read its single data element;
94 for a Structured Type, read a value for each attribute of the SQL type.
97 The SDBC driver initializes the input stream with a type map
98 before calling this method, which is used by the appropriate
99 <code>SQLInput.readXXX</code>
100 method on the stream.
104 the input SQL data stream
106 the SQL type of the value on the data stream
108 if a database access error occurs.
110 @see com::sun::star::sdbc::XSQLInput
112 void readSQL
([in]XSQLInput stream
, [in]string typeName
)
113 raises
(SQLException
);
114 //-------------------------------------------------------------------------
116 /** writes this object to the given SQL data stream.
120 The implementation of the method must follow this protocol:
122 It must write each of the attributes of the SQL type to the given output
123 stream. This is done by calling a method of the output stream to write
124 each item, in the order that they appear in the SQL definition of the type.
125 Specifically, it must call the appropriate
126 <code>XSQLOutput.writeXXX</code>
127 method(s) to do the following:<br>
128 for a Distinct Type, write its single data element;
129 for a Structured Type, write a value for each attribute of the SQL type.
132 the output SQL data stream
134 if a database access error occurs.
135 @see com::sun::star::sdbc::XSQLOutput
137 void writeSQL
([in]XSQLOutput stream
) raises
(SQLException
);
140 //=============================================================================
144 /*===========================================================================
145 ===========================================================================*/