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: XDriver.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 ************************************************************************/
30 #ifndef __com_sun_star_sdbc_XDriver_idl__
31 #define __com_sun_star_sdbc_XDriver_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_beans_PropertyValue_idl__
38 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
41 #ifndef __com_sun_star_sdbc_SQLException_idl__
42 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
45 #ifndef __com_sun_star_sdbc_DriverPropertyInfo_idl__
46 #include
<com
/sun
/star
/sdbc
/DriverPropertyInfo.idl
>
49 module com
{ module sun
{ module star
{ module sdbc
{
51 published
interface XConnection
;
52 published
interface XDriverManager
;
55 /** is the interface that every driver class must implement.
60 Each driver should supply a service that implements
64 <p>The DriverManager will try to load as many drivers as it can
65 find, and then for any given connection request, it will ask each
66 driver in turn to try to connect to the target URL.
70 It is strongly recommended that each Driver object should be
71 small and standalone so that the Driver object can be loaded and
72 queried without bringing in vast quantities of supporting code.
75 @see com::sun::star::sdbc::XDriverManager
76 @see com::sun::star::sdbc::XConnection
78 published
interface XDriver
: com
::sun
::star
::uno
::XInterface
81 /** attempts to make a database connection to the given URL.
82 The driver should return
84 if it realizes it is the wrong kind
85 of driver to connect to the given URL. This will be common, as when
86 the driver manager is asked to connect to a given URL it passes
87 the URL to each loaded driver in turn.
92 The driver should raise a
93 <type scope="com::sun::star::sdbc">SQLException</type>
95 driver to connect to the given URL, but has trouble connecting to
100 The info argument can be used to pass arbitrary
101 string tag/value pairs as connection arguments.
102 Normally at least "user" and "password" properties should be
103 included in the Properties. For a JDBC driver also the Java class must
104 be supplied in the property named JavaDriverClass, and a class path (a
105 space-separated list of URLs) needed to locate that class can optionally
106 be supplied in a property named JavaDriverClassPath.
107 Possible property value names are when supported by the driver:
108 @see com::sun::star::sdbc::ConnectionProperties
112 is the URL of the database to which to connect.
114 a list of arbitrary string tag/value pairs as connection arguments. Normally at least a "user" and "password" property should be included.
115 @see com::sun::star::sdbc::ConnectionProperties
117 a Connection object that represents a connection to the URL
119 if a database access error occurs
124 [in]sequence
<com
::sun
::star
::beans
::PropertyValue
> info
)
125 raises
(SQLException
);
126 //-------------------------------------------------------------------------
128 /** returns <TRUE/> if the driver thinks that it can open a connection
129 to the given URL. Typically drivers will return <TRUE/> if they
130 understand the subprotocol specified in the URL and <FALSE/> if
134 is the URL of the database to which to connect.
136 <TRUE/> if this driver can connect to the given URL.
138 if a database access error occurs.
140 boolean acceptsURL
([in]string url
) raises
(SQLException
);
141 //-------------------------------------------------------------------------
143 /** gets information about the possible properties for this driver.
144 <p>The getPropertyInfo method is intended to allow a generic GUI tool to
145 discover what properties it should prompt a human for in order to get
146 enough information to connect to a database. Note that depending on
147 the values the human has supplied so far, additional values may become
148 necessary, so it may be necessary to iterate though several calls
151 is the URL of the database to which to connect.
153 is a proposed list of tag/value pairs that will be sent on
156 an array of DriverPropertyInfo objects describing possible
157 properties. This array may be an empty array if no properties
160 if a database access error occurs.
162 sequence
<DriverPropertyInfo
> getPropertyInfo
([in]string url
,
163 [in] sequence
<com
::sun
::star
::beans
::PropertyValue
> info
)
164 raises
(SQLException
);
165 //-------------------------------------------------------------------------
167 /** gets the driver's major version number. Initially this should be 1.
169 this driver's major version number
171 long getMajorVersion
();
172 //-------------------------------------------------------------------------
174 /** gets the driver's minor version number. Initially this should be 0.
176 this driver's minor version number.
178 long getMinorVersion
();
181 //=============================================================================