use insert function instead of for loop
[LibreOffice.git] / offapi / com / sun / star / sdbc / XDriver.idl
blob390fa83d72bdc7b1ecd2d63bb531747ca84d70f9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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.
30 <p>
31 Each driver should supply a service that implements
32 the Driver interface.
34 </p>
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.
39 </p>
40 <p>
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.
45 </p>
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
54 `NULL`
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.
62 <p>
63 The driver should raise a
64 com::sun::star::sdbc::SQLException
65 if it is the right
66 driver to connect to the given URL, but has trouble connecting to
67 the database.
69 </p>
70 <p>
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
80 </p>
82 @param url
83 is the URL of the database to which to connect.
84 @param info
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
87 @returns
88 a Connection object that represents a connection to the URL
89 @throws SQLException
90 if a database access error occurs
93 XConnection connect(
94 [in]string url,
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
101 they do not.
103 @param url
104 is the URL of the database to which to connect.
105 @returns
106 `TRUE` if this driver can connect to the given URL.
107 @throws SQLException
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
118 to getPropertyInfo.
119 @param url
120 is the URL of the database to which to connect.
121 @param info
122 is a proposed list of tag/value pairs that will be sent on
123 connect open.
124 @returns
125 an array of DriverPropertyInfo objects describing possible
126 properties. This array may be an empty array if no properties
127 are required.
128 @throws SQLException
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.
136 @returns
137 this driver's major version number
139 long getMajorVersion();
141 /** gets the driver's minor version number. Initially this should be 0.
142 @returns
143 this driver's minor version number.
145 long getMinorVersion();
149 }; }; }; };
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */