xref: /AOO41X/main/offapi/com/sun/star/sdbc/XDriverManager.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_sdbc_XDriverManager_idl__
24#define __com_sun_star_sdbc_XDriverManager_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_beans_PropertyValue_idl__
31#include <com/sun/star/beans/PropertyValue.idl>
32#endif
33
34#ifndef __com_sun_star_sdbc_SQLException_idl__
35#include <com/sun/star/sdbc/SQLException.idl>
36#endif
37
38 module com {  module sun {  module star {  module sdbc {
39
40 published interface XConnection;
41 published interface XDriver;
42
43
44/** is the basic interface for managing a set of SDBC drivers.
45
46
47
48    <p>
49    When the method
50    <member scope="com::sun::star::sdbc">XDriverManager::getConnection()</member>
51    is called,
52    the DriverManager will attempt to
53    locate a suitable driver.
54
55    </p>
56    @see com::sun::star::sdbc::XDriver
57     @see com::sun::star::sdbc::XConnection
58 */
59published interface XDriverManager: com::sun::star::uno::XInterface
60{
61    //-------------------------------------------------------------------------
62
63    /** attempts to establish a connection to the given database URL.
64        The DriverManager attempts to select an appropriate driver from
65        the set of registered JDBC/SDBC drivers.
66        @param url
67            a database url of the form  sdbc:subprotocol:subname
68        @returns
69            the Connection object
70        @throws SQLException
71            if a database access error occurs.
72     */
73    XConnection getConnection([in]string url)
74        raises (SQLException);
75    //-------------------------------------------------------------------------
76
77    /** attempts to establish a connection to the given database URL.
78        The DriverManager attempts to select an appropriate driver from
79        the set of registered JDBC/SDBC drivers.
80        @param url
81            a database url of the form  sdbc:subprotocol:subname
82        @param info
83            a list of arbitrary string tag/value pairs as connection arguments;
84            normally at least a "user" and "password" property should be included
85            @see com::sun::star::sdbc::ConnectionProperties
86        @returns
87            the Connection object
88        @throws SQLException
89            if a database access error occurs.
90     */
91    XConnection getConnectionWithInfo([in]string url,
92            [in]sequence<com::sun::star::beans::PropertyValue> info)
93        raises (SQLException);
94    //-------------------------------------------------------------------------
95
96    /** sets the maximum time in seconds that a driver will wait
97        while attempting to connect to a database.
98        @param seconds
99            the login time limit in seconds
100
101        @throws SQLException
102            if a database access error occurs.
103     */
104    void setLoginTimeout([in]long seconds);
105    //-------------------------------------------------------------------------
106
107    /** gets the maximum time in seconds that a driver can wait
108        when attempting to login to a database.
109        @returns
110            the driver login time limit in seconds
111
112        @throws SQLException
113            if a database access error occurs.
114     */
115    long getLoginTimeout();
116};
117
118//=============================================================================
119
120}; }; }; };
121
122#endif
123