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 module com
{ module sun
{ module star
{ module sdbc
{
22 published
interface XConnection
;
23 published
interface XDriverManager
;
26 /** is the interface that every driver class must implement.
31 Each driver should supply a service that implements
35 <p>The DriverManager will try to load as many drivers as it can
36 find, and then for any given connection request, it will ask each
37 driver in turn to try to connect to the target URL.
41 It is strongly recommended that each Driver object should be
42 small and standalone so that the Driver object can be loaded and
43 queried without bringing in vast quantities of supporting code.
46 @see com::sun::star::sdbc::XDriverManager
47 @see com::sun::star::sdbc::XConnection
49 published
interface XDriver
: com
::sun
::star
::uno
::XInterface
52 /** attempts to make a database connection to the given URL.
53 The driver should return
55 if it realizes it is the wrong kind
56 of driver to connect to the given URL. This will be common, as when
57 the driver manager is asked to connect to a given URL it passes
58 the URL to each loaded driver in turn.
63 The driver should raise a
64 com::sun::star::sdbc::SQLException
66 driver to connect to the given URL, but has trouble connecting to
71 The info argument can be used to pass arbitrary
72 string tag/value pairs as connection arguments.
73 Normally at least "user" and "password" properties should be
74 included in the Properties. For a JDBC driver also the Java class must
75 be supplied in the property named JavaDriverClass, and a class path (a
76 space-separated list of URLs) needed to locate that class can optionally
77 be supplied in a property named JavaDriverClassPath.
78 Possible property value names are when supported by the driver:
79 @see com::sun::star::sdbc::ConnectionProperties
83 is the URL of the database to which to connect.
85 a list of arbitrary string tag/value pairs as connection arguments. Normally at least a "user" and "password" property should be included.
86 @see com::sun::star::sdbc::ConnectionProperties
88 a Connection object that represents a connection to the URL
90 if a database access error occurs
95 [in]sequence
<com
::sun
::star
::beans
::PropertyValue
> info
)
96 raises
(SQLException
);
98 /** returns `TRUE` if the driver thinks that it can open a connection
99 to the given URL. Typically drivers will return `TRUE` if they
100 understand the subprotocol specified in the URL and `FALSE` if
104 is the URL of the database to which to connect.
106 `TRUE` if this driver can connect to the given URL.
108 if a database access error occurs.
110 boolean acceptsURL
([in]string url
) raises
(SQLException
);
112 /** gets information about the possible properties for this driver.
113 <p>The getPropertyInfo method is intended to allow a generic GUI tool to
114 discover what properties it should prompt a human for in order to get
115 enough information to connect to a database. Note that depending on
116 the values the human has supplied so far, additional values may become
117 necessary, so it may be necessary to iterate though several calls
120 is the URL of the database to which to connect.
122 is a proposed list of tag/value pairs that will be sent on
125 an array of DriverPropertyInfo objects describing possible
126 properties. This array may be an empty array if no properties
129 if a database access error occurs.
131 sequence
<DriverPropertyInfo
> getPropertyInfo
([in]string url
,
132 [in] sequence
<com
::sun
::star
::beans
::PropertyValue
> info
)
133 raises
(SQLException
);
135 /** gets the driver's major version number. Initially this should be 1.
137 this driver's major version number
139 long getMajorVersion
();
141 /** gets the driver's minor version number. Initially this should be 0.
143 this driver's minor version number.
145 long getMinorVersion
();
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */