1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XConnectionTools.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_sdb_tools_XConnectionTools_idl__
32 #define __com_sun_star_sdb_tools_XConnectionTools_idl__
34 #ifndef __com_sun_star_uno_XInterface_idl__
35 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_sdbc_SQLException_idl__
38 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
41 module com
{ module sun
{ module star
{
43 interface XNameAccess
;
49 //=============================================================================
50 module com
{ module sun
{ module star
{ module sdb
{
51 interface XSingleSelectQueryComposer
;
53 //=============================================================================
56 interface XObjectNames
;
57 interface XDataSourceMetaData
;
59 //-----------------------------------------------------------------------------
60 /** encapsulates various useful functionality around a
61 <type scope="com::sun::star::sdb">Connection</type>
63 <p>Most of the functionality provided here is meaningful only relative to
64 a given database connection. For instance, for quoting table names, you need
65 the meta data instance of the connection. Thus, the entry point for obtaining
66 a <type>XConnectionTools</type> instance is the
67 <type scope="com::sun::star::sdb">Connection</type> service.</p>
69 <p>Note that nearly all functionality provided by this interface is also
70 available by other means, it's only provided here for convenience purposes.</p>
74 interface XConnectionTools
76 /** creates an instance supporting the <type>XTableName</type> interface,
77 which can be used to manipulate table names for various purposes.
79 <p>The returned object is guanrateed to not be <NULL/>.</p>
81 XTableName createTableName
();
83 /** returns an instance supporting the <type>XObjectNames</type> interface,
84 which provides access to functionality around table and query names.
86 <p>The returned object is guanrateed to not be <NULL/>.</p>
88 XObjectNames getObjectNames
();
90 /** provides access to the application-level data source meta data
93 getDataSourceMetaData
();
95 /** get fields for a result set given by a "command descriptor"
97 <p>A command descriptor here means:
98 <ul><li>a SDB-level connection (<type scope="com.sun.star.sdb">Connection</type></li>
99 <li>a string specifying the name of an object relative to the connection</li>
100 <li>a <type scope="com.sun.star.sdb">CommandType</type> value specifying the type
101 of the object</type></li>
106 the type of the object
109 the object. This may be a table name, a query name, or an SQL statement, depending on the value
110 of <arg>_nCommandType</arg>
112 @param _rxCollectionOner
113 If (and only if) <arg>CommandType</arg> is CommandType.COMMAND, the fields collection which is returned
114 by this function here is a temporary object. It is kept alive by another object, which is to be
115 created temporarily, too. To ensure that the fields you get are valid as long as you need them,
116 the owner which controls their life time is transfered to this parameter upon return.<br/>
118 Your fields live as long as this component lives.<br/>
120 Additionally, you are encouraged to dispose this component as soon as you don't need the fields anymore.
121 It depends on the connection's implementation if this is necessary, but the is no guarantee, so to
122 be on the safe side with respect to resource leaks, you should dispose the component.
125 the container of the columns (aka fields) of the object
127 ::com
::sun
::star
::container
::XNameAccess getFieldsByCommandDescriptor
( [in] long commandType
,
129 [out] ::com
::sun
::star
::lang
::XComponent keepFieldsAlive
130 ) raises
( com
::sun
::star
::sdbc
::SQLException
);
132 /** get the composer initialized with a command and command type.
134 the type of the object
137 the object. This may be a table name, a query name, or an SQL statement, depending on the value
138 of <arg>_nCommandType</arg>
140 the composer filled with command and command type.
142 ::com
::sun
::star
::sdb
::XSingleSelectQueryComposer getComposer
([in] long commandType
,[in] string command
);
145 //=============================================================================
147 //=============================================================================