1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_sdb_tools_XConnectionTools_idl__
21 #define __com_sun_star_sdb_tools_XConnectionTools_idl__
23 #include
<com
/sun
/star
/uno
/XInterface.idl
>
24 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
26 module com
{ module sun
{ module star
{
28 interface XNameAccess
;
34 module com
{ module sun
{ module star
{ module sdb
{
35 interface XSingleSelectQueryComposer
;
39 interface XObjectNames
;
40 interface XDataSourceMetaData
;
42 /** encapsulates various useful functionality around a
43 com::sun::star::sdb::Connection
45 <p>Most of the functionality provided here is meaningful only relative to
46 a given database connection. For instance, for quoting table names, you need
47 the meta data instance of the connection. Thus, the entry point for obtaining
48 a XConnectionTools instance is the
49 com::sun::star::sdb::Connection service.</p>
51 <p>Note that nearly all functionality provided by this interface is also
52 available by other means, it's only provided here for convenience purposes.</p>
56 interface XConnectionTools
58 /** creates an instance supporting the XTableName interface,
59 which can be used to manipulate table names for various purposes.
61 <p>The returned object is guaranteed to not be `NULL`.</p>
63 XTableName createTableName
();
65 /** returns an instance supporting the XObjectNames interface,
66 which provides access to functionality around table and query names.
68 <p>The returned object is guaranteed to not be `NULL`.</p>
70 XObjectNames getObjectNames
();
72 /** provides access to the application-level data source meta data
75 getDataSourceMetaData
();
77 /** get fields for a result set given by a "command descriptor"
79 <p>A command descriptor here means:
80 <ul><li>a SDB-level connection (com.sun.star.sdb::Connection</li>
81 <li>a string specifying the name of an object relative to the connection</li>
82 <li>a com.sun.star.sdb::CommandType value specifying the type
88 the type of the object
91 the object. This may be a table name, a query name, or an SQL statement, depending on the value
94 @param keepFieldsAlive
95 If (and only if) CommandType is CommandType.COMMAND, the fields collection which is returned
96 by this function here is a temporary object. It is kept alive by another object, which is to be
97 created temporarily, too. To ensure that the fields you get are valid as long as you need them,
98 the owner which controls their life time is transferred to this parameter upon return.<br/>
99 Your fields live as long as this component lives.<br/>
100 Additionally, you are encouraged to dispose this component as soon as you don't need the fields anymore.
101 It depends on the connection's implementation if this is necessary, but the is no guarantee, so to
102 be on the safe side with respect to resource leaks, you should dispose the component.
105 the container of the columns (aka fields) of the object
107 ::com
::sun
::star
::container
::XNameAccess getFieldsByCommandDescriptor
( [in] long commandType
,
109 [out] ::com
::sun
::star
::lang
::XComponent keepFieldsAlive
110 ) raises
( com
::sun
::star
::sdbc
::SQLException
);
112 /** get the composer initialized with a command and command type.
114 the type of the object
117 the object. This may be a table name, a query name, or an SQL statement, depending on the value
120 the composer filled with command and command type.
122 ::com
::sun
::star
::sdb
::XSingleSelectQueryComposer getComposer
([in] long commandType
,[in] string command
);
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */