diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /offapi/com/sun/star/sdbc | |
parent | Initial commit. (diff) | |
download | libreoffice-upstream/4%7.4.7.tar.xz libreoffice-upstream/4%7.4.7.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'offapi/com/sun/star/sdbc')
75 files changed, 11044 insertions, 0 deletions
diff --git a/offapi/com/sun/star/sdbc/BatchUpdateException.idl b/offapi/com/sun/star/sdbc/BatchUpdateException.idl new file mode 100644 index 000000000..50018f5d7 --- /dev/null +++ b/offapi/com/sun/star/sdbc/BatchUpdateException.idl @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_BatchUpdateException_idl__ +#define __com_sun_star_sdbc_BatchUpdateException_idl__ + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is thrown when an error occurs during a batch update operation. + + + <p>In addition to the information provided by + com::sun::star::sdbc::SQLException + , a + <code>BatchUpdateException</code> + provides the update counts for all commands + that were executed successfully during the batch update, that is, all commands + that were executed before the error occurred. The order of elements in an + array of update counts corresponds to the order in which commands were added + to the batch.</p> + */ +published exception BatchUpdateException: SQLException +{ + + /** is an array of + <code>long</code> + , with each element + indicating the update count for a SQL command that executed + successfully before the exception was thrown. + */ + sequence<long> UpdateCounts; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/BestRowScope.idl b/offapi/com/sun/star/sdbc/BestRowScope.idl new file mode 100644 index 000000000..da8d66a9b --- /dev/null +++ b/offapi/com/sun/star/sdbc/BestRowScope.idl @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_BestRowScope_idl__ +#define __com_sun_star_sdbc_BestRowScope_idl__ + + module com { module sun { module star { module sdbc { + + +/** determines how long a row identifier is valid. + */ +published constants BestRowScope +{ + + /** indicates that the scope of the best row identifier is + very temporary, lasting only while the row is being used. + A possible value for the column + <code>SCOPE</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + XDatabaseMetaData::getBestRowIdentifier(). + */ + const long TEMPORARY = 0; + + /** indicates that the scope of the best row identifier is + the remainder of the current transaction. + A possible value for the column + <code>SCOPE</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + XDatabaseMetaData::getBestRowIdentifier(). + */ + const long TRANSACTION = 1; + + /** indicates that the scope of the best row identifier is + the remainder of the current session. + A possible value for the column + <code>SCOPE</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + XDatabaseMetaData::getBestRowIdentifier(). + */ + const long SESSION = 2; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/BestRowType.idl b/offapi/com/sun/star/sdbc/BestRowType.idl new file mode 100644 index 000000000..df95e3fb4 --- /dev/null +++ b/offapi/com/sun/star/sdbc/BestRowType.idl @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_BestRowType_idl__ +#define __com_sun_star_sdbc_BestRowType_idl__ + + module com { module sun { module star { module sdbc { + + +/** determines the type of the best row identifier. + */ +published constants BestRowType +{ + + /** indicates that the best row identifier may or may not be a pseudo-column. + A possible value for the column + <code>PSEUDO_COLUMN</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + XDatabaseMetaData::getBestRowIdentifier(). + */ + const long UNKNOWN = 0; + + /** indicates that the best row identifier is NOT a pseudo-column. + A possible value for the column + <code>PSEUDO_COLUMN</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + XDatabaseMetaData::getBestRowIdentifier(). + */ + const long NOT_PSEUDO = 1; + + /** indicates that the best row identifier is a pseudo-column. + A possible value for the column + <code>PSEUDO_COLUMN</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + XDatabaseMetaData::getBestRowIdentifier(). + */ + const long PSEUDO = 2; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/CallableStatement.idl b/offapi/com/sun/star/sdbc/CallableStatement.idl new file mode 100644 index 000000000..b61cd0c48 --- /dev/null +++ b/offapi/com/sun/star/sdbc/CallableStatement.idl @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_CallableStatement_idl__ +#define __com_sun_star_sdbc_CallableStatement_idl__ + +#include <com/sun/star/sdbc/PreparedStatement.idl> + + module com { module sun { module star { module sdbc { + + published interface XRow; + published interface XOutParameters; + + +/** is used to execute SQL stored procedures. + + + <p> + SDBC provides a stored procedure SQL escape that allows stored procedures + to be called in a standard way for all RDBMSs. This escape syntax has one + form that includes a result parameter and one that does not. If used, the + result parameter must be registered as an OUT parameter. The other parameters + can be used for input, output, or both. Parameters are referred to sequentially, + by number. The first parameter is 1. + </p> + <p> + <code>{?=call&lt;procedure-name&gt;[&lt;arg1&gt;,&lt;arg2&gt;,...]}<br/>{call&lt;procedure-name&gt;[&lt;arg1&gt;,&lt;arg2&gt;,...]} + </code> + </p> + <p> + IN parameter values are set using the set methods inherited from + com::sun::star::sdbc::PreparedStatement + . The type of all + OUT parameters must be registered prior to executing the stored procedure; + their values are retrieved after execution via the + <code>get</code> methods provided by the com::sun::star::sdbc::XRow. + </p> + <p> + A + <code>CallableStatement</code> + can return one + com::sun::star::sdbc::XResultSet + or multiple + com::sun::star::sdbc::ResultSet + objects. Multiple + <code>ResultSet</code> + objects are handled using operations inherited from + com::sun::star::sdbc::XPreparedStatement. + </p> + <p> + For maximum portability, a call's + com::sun::star::sdbc::ResultSet + objects and + update counts should be processed prior to getting the values of output + parameters. + </p> +*/ +published service CallableStatement +{ + service PreparedStatement; + + + /** is used for retrieve the values of OUT parameters. + */ + interface XRow; + + + /** is used to declare parameters as OUT parameters. + */ + interface XOutParameters; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ChangeAction.idl b/offapi/com/sun/star/sdbc/ChangeAction.idl new file mode 100644 index 000000000..097f608f5 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ChangeAction.idl @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ChangeAction_idl__ +#define __com_sun_star_sdbc_ChangeAction_idl__ + +module com { module sun { module star { module sdbc { + +/** @deprecated determines the type of the change which is going to be performed. +*/ +published constants ChangeAction +{ + /** + indicates that an insert will be performed. + */ + const long INSERT = 1; + /** + indicates that an update will be performed. + */ + const long UPDATE = 2; + /** + indicates that a delete will be performed. + */ + const long DELETE = 3; + /** + indicates that an undo will be performed. + */ + const long UNDO = 4; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ChangeEvent.idl b/offapi/com/sun/star/sdbc/ChangeEvent.idl new file mode 100644 index 000000000..a680c5b83 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ChangeEvent.idl @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ChangeEvent_idl__ +#define __com_sun_star_sdbc_ChangeEvent_idl__ + +#include <com/sun/star/lang/EventObject.idl> + +module com { module sun { module star { module sdbc { + +/** @deprecated indicates the type of change action on the data source. +*/ +published struct ChangeEvent : com::sun::star::lang::EventObject +{ + /** indicates the type of change. + @see com::sun::star::sdbc::ChangeAction + */ + long Action; + + /** indicates the number of rows affected by the change. */ + long Rows; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ColumnSearch.idl b/offapi/com/sun/star/sdbc/ColumnSearch.idl new file mode 100644 index 000000000..200179475 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ColumnSearch.idl @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ColumnSearch_idl__ +#define __com_sun_star_sdbc_ColumnSearch_idl__ + + module com { module sun { module star { module sdbc { + + +/** indicates in which way a column can be used in the WHERE search. + */ +published constants ColumnSearch +{ + + /** A possible value for column <code>SEARCHABLE</code> in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getTypeInfo(). + <p> + Indicates that + <code>WHERE</code> + search clauses are not supported + for this type. + */ + const long NONE = 0; + + /** A possible value for column <code>SEARCHABLE</code> in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getTypeInfo(). + <p> + Indicates that the only + <code>WHERE</code> + search clause that can + be based on this type is + <code>WHERE...LIKE</code>. + */ + const long CHAR = 1; + + /** A possible value for column <code>SEARCHABLE</code> in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc">XDatabaseMetaData::getTypeInfo(). + <p> + Indicates that one can base all + <code>WHERE</code> + search clauses + except + <code>WHERE...LIKE</code> + on this data type. + */ + const long BASIC = 2; + + /** A possible value for column + <code>SEARCHABLE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc">XDatabaseMetaData::getTypeInfo(). + <p> + Indicates that all + <code>WHERE</code> + search clauses can be + based on this type. + */ + const long FULL = 3; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ColumnType.idl b/offapi/com/sun/star/sdbc/ColumnType.idl new file mode 100644 index 000000000..026d24a72 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ColumnType.idl @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ColumnType_idl__ +#define __com_sun_star_sdbc_ColumnType_idl__ + + module com { module sun { module star { module sdbc { + + +/** determines the type of a version column. + */ +published constants ColumnType +{ + + /** indicates that this column may or may not be a pseudo-column. + A possible value for the column + <code>PSEUDO_COLUMN</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getVersionColumns(). + */ + const long UNKNOWN = 0; + + /** indicates that this column is NOT a pseudo-column. + A possible value for the column + <code>PSEUDO_COLUMN</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getVersionColumns(). + */ + const long NOT_PSEUDO = 1; + + /** indicates that this column is a pseudo-column. + A possible value for the column + <code>PSEUDO_COLUMN</code> + in the + com::sun::star::sdbc::XResultSet object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getVersionColumns(). + */ + const long PSEUDO = 2; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ColumnValue.idl b/offapi/com/sun/star/sdbc/ColumnValue.idl new file mode 100644 index 000000000..92d280a10 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ColumnValue.idl @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ColumnValue_idl__ +#define __com_sun_star_sdbc_ColumnValue_idl__ + + module com { module sun { module star { module sdbc { + + +/** determines whether a column allows SQL NULL values or not. + */ +published constants ColumnValue +{ + + /** indicates that a column does not allow NULL values. + */ + const long NO_NULLS = 0; + + /** indicates that a column does allow NULL values. + */ + const long NULLABLE = 1; + + /** indicates that the nullability of the column is unknown. + */ + const long NULLABLE_UNKNOWN = 2; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/Connection.idl b/offapi/com/sun/star/sdbc/Connection.idl new file mode 100644 index 000000000..2c98d81e0 --- /dev/null +++ b/offapi/com/sun/star/sdbc/Connection.idl @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_Connection_idl__ +#define __com_sun_star_sdbc_Connection_idl__ + +#include <com/sun/star/lang/XComponent.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; + published interface XWarningsSupplier; + + +/** represents a connection (session) with a specific + database. Within the context of a Connection, SQL statements are + executed and results are returned. + + <p> + A Connection's database is able to provide information + describing its tables, its supported SQL grammar, its stored + procedures, and the capabilities of this connection. This + information is obtained with the + com::sun::star::sdbc::XConnection::getMetaData() + method. + </p> + <p> + <b> + Note: + </b> + By default the Connection automatically commits + changes after executing each statement. If auto commit has been + disabled, an explicit commit must be done or database changes will + not be saved. + + </p> + @see com::sun::star::sdbc::XStatement + @see com::sun::star::sdbc::XResultSet + @see com::sun::star::sdbc::XDatabaseMetaData + */ +published service Connection +{ + + /** controls the closing of a connection. + */ + interface com::sun::star::lang::XComponent; + + + /** the main interface for interaction with a connection to a database. + */ + interface XConnection; + + + /** controls the chaining of warnings, which may occur on every call + to the connected database. Chained warnings from previous calls will be + cleared before processing a new call. + */ + interface XWarningsSupplier; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ConnectionPool.idl b/offapi/com/sun/star/sdbc/ConnectionPool.idl new file mode 100644 index 000000000..31d12d866 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ConnectionPool.idl @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ConnectionPool_idl__ +#define __com_sun_star_sdbc_ConnectionPool_idl__ + + module com { module sun { module star { module sdbc { + + published interface XConnectionPool; + + +/** is the basic service for pooling SDBC connections. + + <p> + When the method + com::sun::star::sdbc::XPooledConnection::getConnection() + is called, + the ConnectionPool will attempt to locate a suitable pooled connection + or create a new connection from the DriverManager. When the connection + will be released it will move to the pool of unused connections. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XConnection + */ +published service ConnectionPool: XConnectionPool; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ConnectionProperties.idl b/offapi/com/sun/star/sdbc/ConnectionProperties.idl new file mode 100644 index 000000000..c12689533 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ConnectionProperties.idl @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ConnectionProperties_idl__ +#define __com_sun_star_sdbc_ConnectionProperties_idl__ + + module com { module sun { module star { module sdbc { + + + +/** represents the properties for a connection (session) with a specific + database. These properties can be used when calling the method + com::sun::star::sdbc::XDriver::connect() or + com::sun::star::sdbc::XDriverManager::getConnectionWithInfo(). + + <p> + The properties for a connection contain additional information about how to connect to a database and + how to control the behavior of the resulting connection should be. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::JDBCConnectionProperties + @see com::sun::star::sdbc::ODBCConnectionProperties + @see com::sun::star::sdbc::FILEConnectionProperties + @see com::sun::star::sdbc::DBASEConnectionProperties + @see com::sun::star::sdbc::FLATConnectionProperties + + */ +published service ConnectionProperties +{ + /** the username + */ + [optional, property] string user; + + /** the password + */ + [optional, property] string password; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/DBASEConnectionProperties.idl b/offapi/com/sun/star/sdbc/DBASEConnectionProperties.idl new file mode 100644 index 000000000..58fd2afde --- /dev/null +++ b/offapi/com/sun/star/sdbc/DBASEConnectionProperties.idl @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_DBASEConnectionProperties_idl__ +#define __com_sun_star_sdbc_DBASEConnectionProperties_idl__ + +#include <com/sun/star/sdbc/FILEConnectionProperties.idl> + +module com { module sun { module star { module sdbc { + +/** represents the properties for a dBase connection (session) with a specific + database. These properties can be used when calling the method + com::sun::star::sdbc::XDriver::connect() or + com::sun::star::sdbc::XDriverManager::getConnectionWithInfo(). + + <p> + The properties for a connection contain additional information about how to connect to a database and + how to control the behavior of the resulting connection should be. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::FILEConnectionProperties + */ +service DBASEConnectionProperties +{ + service com::sun::star::sdbc:: FILEConnectionProperties; + + /** `TRUE` when deleted rows should be shown, otherwise `FALSE` + */ + [optional, property] boolean ShowDeleted; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/DataTruncation.idl b/offapi/com/sun/star/sdbc/DataTruncation.idl new file mode 100644 index 000000000..91363dd6e --- /dev/null +++ b/offapi/com/sun/star/sdbc/DataTruncation.idl @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_DataTruncation_idl__ +#define __com_sun_star_sdbc_DataTruncation_idl__ + +#include <com/sun/star/sdbc/SQLWarning.idl> + + module com { module sun { module star { module sdbc { + + +/** reports a DataTruncation warning, on reads, or is thrown as a DataTruncation exception, + on writes, when a data value is unexpectedly truncated. + + <p> + The SQL state for a + <code>DataTruncation</code> + is <code>01004</code>. + </p> + */ +published exception DataTruncation: SQLWarning +{ + + /** is the index of the parameter or column value. + */ + long Index; + + + /** is + `TRUE` + if a parameter value is truncated. + */ + boolean IsParameter; + + + /** is + `TRUE` + if a read was truncated. + */ + boolean DuringRead; + + + /** contains the number of bytes of data that should have been transferred. + This number may be approximate if data conversions were being + performed. The value may be + <code>-1</code> + if the size is unknown. + */ + long DataSize; + + + /** contains the number of bytes of data actually transferred. + The value may be + <code>-1</code> + if the size is unknown. + */ + long TransferSize; +}; + + +}; }; }; }; +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/DataType.idl b/offapi/com/sun/star/sdbc/DataType.idl new file mode 100644 index 000000000..622f5986e --- /dev/null +++ b/offapi/com/sun/star/sdbc/DataType.idl @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_DataType_idl__ +#define __com_sun_star_sdbc_DataType_idl__ + + module com { module sun { module star { module sdbc { + + +/** These constants are used to specify database data types which are used + to identify the generic SQL types. The definition is based on JDBC 3.0. + + <p> + The actual type constant values are equivalent to those in the X/Open CLI. + </p> + <p> + Precise information about the specific types can be got from + XDatabaseMetaData::getTypeInfo(). + </p> + */ +published constants DataType +{ + const long BIT = -7; + + const long TINYINT = -6; + + const long SMALLINT = 5; + + const long INTEGER = 4; + + const long BIGINT = -5; + + const long FLOAT = 6; + + const long REAL = 7; + + const long DOUBLE = 8; + + const long NUMERIC = 2; + + const long DECIMAL = 3; + + const long CHAR = 1; + + const long VARCHAR = 12; + + const long LONGVARCHAR = -1; + + const long DATE = 91; + + const long TIME = 92; + + const long TIMESTAMP = 93; + + const long BINARY = -2; + + const long VARBINARY = -3; + + const long LONGVARBINARY = -4; + + const long SQLNULL = 0; + + + /** indicates that the SQL type is database-specific and + gets mapped to an object that can be accessed via + the method com::sun::star::sdbc::XRow::getObject(). + */ + const long OTHER = 1111; + + + /** indicates a type which is represented by an object which implements + this type. + */ + const long OBJECT = 2000; + + + /** describes a type based on a built-in type. + It is a user-defined data type (UDT). + */ + const long DISTINCT = 2001; + + + /** indicates a type consisting of attributes that may be any type. + It is a user-defined data type (UDT). + */ + const long STRUCT = 2002; + + + /** indicates a type representing an SQL ARRAY. + */ + const long ARRAY = 2003; + + + /** indicates a type representing an SQL Binary Large Object. + */ + const long BLOB = 2004; + + + /** indicates a type representing an SQL Character Large Object. + */ + const long CLOB = 2005; + + + /** indicates a type representing an SQL REF, a referencing type. + */ + const long REF = 2006; + + /** identifies the generic SQL type + * <code>BOOLEAN</code>. + * + * @since OOo 2.0 + */ + const long BOOLEAN = 16; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/Deferrability.idl b/offapi/com/sun/star/sdbc/Deferrability.idl new file mode 100644 index 000000000..3f42ca8bb --- /dev/null +++ b/offapi/com/sun/star/sdbc/Deferrability.idl @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_Deferrability_idl__ +#define __com_sun_star_sdbc_Deferrability_idl__ + + module com { module sun { module star { module sdbc { + + +/** indicates the Deferrability of key constraints. + */ +published constants Deferrability +{ + + /** A possible value for the column <code>DEFERRABILITY</code> + in the + <code>XResultSet</code> objects returned by the methods + <code>getImportedKeys</code>, <code>getExportedKeys</code>, + and <code>getCrossReference</code>. + <P>Indicates deferrability. See SQL-92 for a definition. + +<!-- JRH: This and next two comments are identical. Is something missing? + INITIALLY_DEFERRED, INITIALLY_IMMEDIATE, and NONE? --> +*/ + const long INITIALLY_DEFERRED = 5; + + /** A possible value for the column <code>DEFERRABILITY</code> + in the + <code>XResultSet</code> objects returned by the methods + <code>getImportedKeys</code>, <code>getExportedKeys</code>, + and <code>getCrossReference</code>. + <P>Indicates deferrability. See SQL-92 for a definition. + */ + const long INITIALLY_IMMEDIATE = 6; + + /** A possible value for the column <code>DEFERRABILITY</code> + in the + <code>XResultSet</code> objects returned by the methods + <code>getImportedKeys</code>, <code>getExportedKeys</code>, + and <code>getCrossReference</code>. + <P>Indicates deferrability. See SQL-92 for a definition. + */ + const long NONE = 7; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/Driver.idl b/offapi/com/sun/star/sdbc/Driver.idl new file mode 100644 index 000000000..4197838b7 --- /dev/null +++ b/offapi/com/sun/star/sdbc/Driver.idl @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_Driver_idl__ +#define __com_sun_star_sdbc_Driver_idl__ + + module com { module sun { module star { module sdbc { + + published interface XDriver; + + +/** is the service that every driver class must implement. + + <p> + Each driver should supply a service that implements + the Driver interface. + + </p> + <p> + The DriverManager will try to load as many drivers as it can + find and then for any given connection request, it will ask each + driver in turn to try to connect to the target URL. + + </p> + <p> + It is strongly recommended that each Driver object should be + small and standalone so that the Driver object can be loaded and + queried without bringing in vast quantities of supporting code. + + </p> + <p> + Each driver should be a one instance service. + + </p> + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::XConnection + */ +published service Driver +{ + + /** is the main interface to access a database driver. + */ + interface XDriver; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/DriverManager.idl b/offapi/com/sun/star/sdbc/DriverManager.idl new file mode 100644 index 000000000..e9166ef91 --- /dev/null +++ b/offapi/com/sun/star/sdbc/DriverManager.idl @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_DriverManager_idl__ +#define __com_sun_star_sdbc_DriverManager_idl__ + +#include <com/sun/star/sdbc/XDriverManager2.idl> + +module com { module sun { module star { module sdbc { + +published service DriverManager : XDriverManager2; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/DriverPropertyInfo.idl b/offapi/com/sun/star/sdbc/DriverPropertyInfo.idl new file mode 100644 index 000000000..6282fc4aa --- /dev/null +++ b/offapi/com/sun/star/sdbc/DriverPropertyInfo.idl @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_DriverPropertyInfo_idl__ +#define __com_sun_star_sdbc_DriverPropertyInfo_idl__ + + module com { module sun { module star { module sdbc { + + +/** describes the driver properties for making a connection. + + + <p> + The DriverPropertyInfo is of interest only to advanced programmers + who need to interact with a driver to discover and supply properties + for connections. + </p> + */ +published struct DriverPropertyInfo +{ + /** is the name of the property. + */ + string Name; + + + /** is a brief description of the property, which may be null. + */ + string Description; + + + /** is + `TRUE` + if a value must be supplied for this property + during + <code>Driver.connect</code> + and + `FALSE` + otherwise. + */ + boolean IsRequired; + + + /** specifies the current value of the property, + based on the driver-supplied default values. This field + may be empty if no value is known. + */ + string Value; + + + /** contains a sequence of possible values if the value for the field + <code>DriverPropertyInfo.value</code> + may be selected + from a particular set of values; otherwise empty. + */ + sequence<string> Choices; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/FILEConnectionProperties.idl b/offapi/com/sun/star/sdbc/FILEConnectionProperties.idl new file mode 100644 index 000000000..43c6d4c74 --- /dev/null +++ b/offapi/com/sun/star/sdbc/FILEConnectionProperties.idl @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_FILEConnectionProperties_idl__ +#define __com_sun_star_sdbc_FILEConnectionProperties_idl__ + +#include <com/sun/star/sdbc/ConnectionProperties.idl> + +module com { module sun { module star { module sdbc { + +/** represents the properties for a FILE connection (session) with a specific + database. These properties can be used when calling the method + com::sun::star::sdbc::XDriver::connect() or + com::sun::star::sdbc::XDriverManager::getConnectionWithInfo(). + + <p> + The properties for a connection contain additional information about how to connect to a database and + how to control the behavior of the resulting connection should be. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::ConnectionProperties + */ +service FILEConnectionProperties +{ + service com::sun::star::sdbc::ConnectionProperties; + + /** specifies the encoding to use to translate the backend data + + <p>See the <a href="http://www.iana.org/assignments/character-sets">IANA character set list</a> + for a list of valid values.</p> + + <p>For internal purposes (e.g., when using an encoding for which no IANA character set name + exists), this may also be an UNSIGNED SHORT value representing one of the rtl_TextEncoding + values in rtl/textenc.h.</p> + */ + [optional, property] string CharSet; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/FLATConnectionProperties.idl b/offapi/com/sun/star/sdbc/FLATConnectionProperties.idl new file mode 100644 index 000000000..99bcfb0b9 --- /dev/null +++ b/offapi/com/sun/star/sdbc/FLATConnectionProperties.idl @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_FLATConnectionProperties_idl__ +#define __com_sun_star_sdbc_FLATConnectionProperties_idl__ + +#include <com/sun/star/sdbc/FILEConnectionProperties.idl> + +module com { module sun { module star { module sdbc { + +/** represents the properties for a FLAT connection (session) with a specific + database. These properties can be used when calling the method + com::sun::star::sdbc::XDriver::connect() or + com::sun::star::sdbc::XDriverManager::getConnectionWithInfo(). + + <p> + The properties for a connection contain additional information about how to connect to a database and + how to control the behavior of the resulting connection should be. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::FILEConnectionProperties + */ +service FLATConnectionProperties +{ + service com::sun::star::sdbc::FILEConnectionProperties; + + /** `TRUE` when the file contains a header line otherwise `FALSE` + */ + [optional, property] boolean HeaderLine; + + /** A one character delimiter to separate the fields. + */ + [optional, property] string FieldDelimiter; + + /** A one character delimiter to separate the strings. + */ + [optional, property] string StringDelimiter; + + /** A one character delimiter to separate the decimal. + */ + [optional, property] string DecimalDelimiter; + + /** A one character delimiter to separate the thousands. + */ + [optional, property] string ThousandDelimiter; + + /** the extension of the files to be used. + */ + [property] string Extension; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/FetchDirection.idl b/offapi/com/sun/star/sdbc/FetchDirection.idl new file mode 100644 index 000000000..1b2fe7158 --- /dev/null +++ b/offapi/com/sun/star/sdbc/FetchDirection.idl @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_FetchDirection_idl__ +#define __com_sun_star_sdbc_FetchDirection_idl__ + + module com { module sun { module star { module sdbc { + + +/** indicates in which direction a result set should fetch next, just for + optimization. + */ +published constants FetchDirection +{ + + /** The rows in a result set will be processed in a forward direction; first-to-last. + */ + const long FORWARD = 1000; + + /** The rows in a result set will be processed in a reverse direction; last-to-first. + */ + const long REVERSE = 1001; + + /** The order in which rows in a result set will be processed is unknown: + */ + const long UNKNOWN = 1002; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/IndexType.idl b/offapi/com/sun/star/sdbc/IndexType.idl new file mode 100644 index 000000000..d3224e997 --- /dev/null +++ b/offapi/com/sun/star/sdbc/IndexType.idl @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_IndexType_idl__ +#define __com_sun_star_sdbc_IndexType_idl__ + + module com { module sun { module star { module sdbc { + + +/** indicates the type of index. + */ +published constants IndexType +{ + + /** A possible value for column + <code>TYPE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getIndexInfo(). + <P> + Identifies table statistics that are returned in conjunction + with a table's index description. + </P> + */ + const short STATISTIC = 0; + + /** A possible value for column + <code>TYPE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getIndexInfo(). + <P> + Indicates that this table index is a clustered index. + </P> + */ + const short CLUSTERED = 1; + + /** A possible value for column + <code>TYPE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getIndexInfo(). + <P> + Indicates that this table index is a hashed index. + </P> + */ + const short HASHED = 2; + + /** A possible value for column + <code>TYPE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getIndexInfo(). + <P> + Indicates that this table index is not a clustered + index, a hashed index, or table statistics; + it is something other than these. + </P> + */ + const short OTHER = 3; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/JDBCConnectionProperties.idl b/offapi/com/sun/star/sdbc/JDBCConnectionProperties.idl new file mode 100644 index 000000000..1c33114b4 --- /dev/null +++ b/offapi/com/sun/star/sdbc/JDBCConnectionProperties.idl @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_JDBCConnectionProperties_idl__ +#define __com_sun_star_sdbc_JDBCConnectionProperties_idl__ + +#include <com/sun/star/sdbc/ConnectionProperties.idl> +#include <com/sun/star/beans/NamedValue.idl> + +module com { module sun { module star { module sdbc { + +/** represents the properties for a JDBC connection (session) with a specific + database. These properties can be used when calling the method + com::sun::star::sdbc::XDriver::connect() or + com::sun::star::sdbc::XDriverManager::getConnectionWithInfo(). + + <p> + The properties for a connection contain additional information about how to connect to a database and + how to control the behavior of the resulting connection should be. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::ConnectionProperties + */ +service JDBCConnectionProperties +{ + service com::sun::star::sdbc::ConnectionProperties; + + /** which JDBC driver class should be loaded to create the connection. + + @see com::sun::star::sdbc::JDBCConnectionProperties::JavaDriverClassPath + */ + [optional, property] string JavaDriverClass; + + /** an optional class path to locate the + com::sun::star::sdbc::JDBCConnectionProperties::JavaDriverClass + + <p>The class path is a list of zero or more internal (see the + com::sun::star::uri::ExternalUriReferenceTranslator + service) URI references, where any space characters + (<code>U+0020</code>) are ignored (and, in particular, separate adjacent + URI references). Any “vnd.sun.star.expand” URL references + in the list are expanded using the + com::sun::star::util::theMacroExpander + singleton.</p> + + @since OOo 2.3 + */ + [optional, property] string JavaDriverClassPath; + + /** specifies a set of properties to pass to <code>java.lang.System.setProperty</code> before + loading the system's JDBC driver. + */ + [optional, property] sequence< ::com::sun::star::beans::NamedValue > SystemProperties; + + /** specifies if retrieving of auto generated values should be enabled or not. + If `TRUE` than the statement will support the XGeneratedResultSet (future concept) interface, otherwise not. + */ + [optional, property] boolean IsAutoRetrievingEnabled; + + /** specifies the statement which should be executed + when asking an "INSERT" statement for the XGeneratedResultSet (future concept) interface. + */ + [optional, property] string AutoRetrievingStatement; + + /** specifies how the type info returned by com::sun::star::sdbc::XDatabaseMetaData::getTypeInfo() will be modified. + <p>The sequence contains an even amount of string values. Each pair describes + what should be searched for and what should be replaced if found. + <br> + The syntax is: + <p> + <ul> + <li>COLUMN(2) = -5</li> + <li>COLUMN(6) = PRECISION</li> + </ul> + </p> + COLUMN(X) defines the column which will be compared and the column which will be replaced. In the example above column 2 will be compared + with the value -5. If this is true than column 6 will now return the value PRECISION. + </p> + */ + [optional, property] sequence< any > TypeInfoSettings; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/KeyRule.idl b/offapi/com/sun/star/sdbc/KeyRule.idl new file mode 100644 index 000000000..30eae77a6 --- /dev/null +++ b/offapi/com/sun/star/sdbc/KeyRule.idl @@ -0,0 +1,161 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_KeyRule_idl__ +#define __com_sun_star_sdbc_KeyRule_idl__ + + module com { module sun { module star { module sdbc { + + +/** determines the rules for foreign key constraints. + */ +published constants KeyRule +{ + + /** a possible value for the column's + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + in the + com::sun::star::sdbc::XResultSet + objects returned by the methods + com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(), + com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(), + and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference(). + <P> + For the column + <code>UPDATE_RULE</code> + , + it indicates that + when the primary key is updated, the foreign key (imported key) + is changed to agree with it. + </P> + <P> + For the column + <code>DELETE_RULE</code> + , + it indicates that + when the primary key is deleted, rows that imported that key + are deleted. + </P> + */ + const long CASCADE = 0; + + /** a possible value for the column's + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + in the + com::sun::star::sdbc::XResultSet + objects returned by the methods + com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(), + com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(), + and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference(). + <P> + For the column + <code>UPDATE_RULE</code> + , it indicates that + a primary key may not be updated if it has been imported by + another table as a foreign key. + </P> + <P> + For the column + <code>DELETE_RULE</code> + , it indicates that + a primary key may not be deleted if it has been imported by + another table as a foreign key. + </P> + */ + const long RESTRICT = 1; + + /** a possible value for the column's + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + in the + com::sun::star::sdbc::XResultSet + objects returned by the methods + com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(), + com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(), + and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference(). + <P> + For the columns + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + , + it indicates that + when the primary key is updated or deleted, the foreign key (imported key) + is changed to <code>NULL</code>. + </P> + */ + const long SET_NULL = 2; + + /** a possible value for the column's + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + in the + com::sun::star::sdbc::XResultSet + objects returned by the methods + com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(), + com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(), + and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference(). + <P> + For the columns + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + , + it indicates that if the primary key has been imported, it cannot be updated or deleted. + </P> + */ + const long NO_ACTION = 3; + + /** a possible value for the column's + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + in the + com::sun::star::sdbc::XResultSet + objects returned by the methods + com::sun::star::sdbc::XDatabaseMetaData::getImportedKeys(), + com::sun::star::sdbc::XDatabaseMetaData::getExportedKeys(), + and com::sun::star::sdbc::XDatabaseMetaData::getCrossReference(). + <P> + For the columns + <code>UPDATE_RULE</code> + and + <code>DELETE_RULE</code> + , + it indicates that + if the primary key is updated or deleted, the foreign key (imported key) + is set to the default value. + </P> + */ + const long SET_DEFAULT = 4; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ODBCConnectionProperties.idl b/offapi/com/sun/star/sdbc/ODBCConnectionProperties.idl new file mode 100644 index 000000000..3f23ba4cc --- /dev/null +++ b/offapi/com/sun/star/sdbc/ODBCConnectionProperties.idl @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ODBCConnectionProperties_idl__ +#define __com_sun_star_sdbc_ODBCConnectionProperties_idl__ + +#include <com/sun/star/sdbc/ConnectionProperties.idl> + +module com { module sun { module star { module sdbc { + +/** represents the properties for an ODBC connection (session) with a specific + database. These properties can be used when calling the method + com::sun::star::sdbc::XDriver::connect() or + com::sun::star::sdbc::XDriverManager::getConnectionWithInfo(). + + <p> + The properties for a connection contain additional information about how to connect to a database and + how to control the behavior of the resulting connection should be. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::ConnectionProperties + */ +service ODBCConnectionProperties +{ + service com::sun::star::sdbc::ConnectionProperties; + /** should the parameter "?" in prepared statement be substituted with an distinct name + */ + [optional, property] boolean ParameterNameSubstitution; + + /** the Timeout after which time a timeout should happen + */ + [optional, property] long Timeout; + + /** Silent - should the connection be silent. No user interaction while creating the connection. + */ + [optional, property] boolean Silent; + + /** should the driver should support a catalog. + */ + [optional, property] boolean UseCatalog; + + /** specifies the encoding to use to translate the backend data + + <p>See the <a href="http://www.iana.org/assignments/character-sets">IANA character set list</a> + for a list of valid values.</p> + */ + [optional, property] string CharSet; + + /** specifies if retrieving of auto generated values should be enabled or not. + If `TRUE` than the statement will support the XGeneratedResultSet (future concept) interface, otherwise not. + */ + [optional, property] boolean IsAutoRetrievingEnabled; + + /** specifies the statement which should be executed + when asking an "INSERT" statement for the XGeneratedResultSet (future concept) interface. + */ + [optional, property] string AutoRetrievingStatement; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/PreparedStatement.idl b/offapi/com/sun/star/sdbc/PreparedStatement.idl new file mode 100644 index 000000000..007f5def8 --- /dev/null +++ b/offapi/com/sun/star/sdbc/PreparedStatement.idl @@ -0,0 +1,258 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_PreparedStatement_idl__ +#define __com_sun_star_sdbc_PreparedStatement_idl__ + +#include <com/sun/star/lang/XComponent.idl> + +#include <com/sun/star/beans/XPropertySet.idl> + +#include <com/sun/star/util/XCancellable.idl> + + module com { module sun { module star { module sdbc { + + published interface XPreparedStatement; + published interface XPreparedBatchExecution; + published interface XParameters; + published interface XWarningsSupplier; + published interface XMultipleResults; + published interface XResultSetMetaDataSupplier; + published interface XCloseable; + + +/** represents a precompiled SQL statement. + <P> + A SQL statement is pre-compiled and stored in a PreparedStatement object. + This object can then be used to efficiently execute this statement multiple + times. + </P> + <P> + <B> + Note: + </B> + The + <code>setXXX</code> + methods for setting IN parameter values + must specify types that are compatible with the defined SQL type of + the input parameter. For instance, if the IN parameter has SQL type + Integer, then the method + com::sun::star::sdbc::XParameters::setInt() + should be used. + </P> + <p> + If arbitrary parameter type conversions are required, the method + com::sun::star::sdbc::XParameters::setObject() + should be used with a target SQL type. + </p> + <p> + Example of setting a parameter; <code>con</code> is an active connection. + @code{.bas} + pstmt = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?") + pstmt.setDouble(1, 153833.00) + pstmt.setLong(2, 110592) + @endcode + </p> + <P> + Only one + com::sun::star::sdbc::ResultSet + per + com::sun::star::sdbc::Statement + can be open at any point in + time. Therefore, if the reading of one ResultSet is interleaved + with the reading of another, each must have been generated by + different Statements. All statement + <code>execute</code> + methods implicitly close a statement's current ResultSet if an open one exists. + </p> + */ +published service PreparedStatement +{ + + /** optional for implementation, controls the releasing of resources + and the notification of registered listeners. + */ + [optional] interface com::sun::star::lang::XComponent; + + + /** freeing all resources of a statement. A related result set will be + freed as well. + */ + interface XCloseable; + + // gives access to the properties. + interface com::sun::star::beans::XPropertySet; + + /** could be used for canceling the execution of SQL statements, if both + the DBMS and the driver support aborting an SQL statement. + The implementation is optional. + */ + [optional] interface com::sun::star::util::XCancellable; + + /** is the interface for executing SQL prepared commands. + */ + interface XPreparedStatement; + + + /** provides access to the description of the result set which would be generated by executing the + PreparedStatement. + */ + interface XResultSetMetaDataSupplier; + + + /** is used for setting parameters before execution of the precompiled + statement. + */ + interface XParameters; + + + /** provides the ability of batch execution. This interface is optional + for execution. + <p> + A driver implementing batch execution must return + `TRUE` + for + com::sun::star::sdbc::XDatabaseMetaData::supportsBatchUpdates() + </p> + */ + [optional] interface XPreparedBatchExecution; + + + /** controls the chaining of warnings, which may occur on every call + to the connected database. Chained warnings from previous calls will be + cleared before processing a new call. + */ + interface XWarningsSupplier; + + + /** covers the handling of multiple results after executing an SQL command. + */ + interface XMultipleResults; + + + /** retrieves the number of seconds the driver will wait for a Statement + to execute. If the limit is exceeded, a SQLException is thrown. + There is no limitation, if set to zero. + */ + [property] long QueryTimeOut; + + + /** returns the maximum number of bytes allowed for any column value. + <p> + This limit is the maximum number of bytes that can be returned + for any column value. The limit applies only to + com::sun::star::sdbc::DataType::BINARY + , + com::sun::star::sdbc::DataType::VARBINARY + , + com::sun::star::sdbc::DataType::LONGVARBINARY + , + com::sun::star::sdbc::DataType::CHAR + , + com::sun::star::sdbc::DataType::VARCHAR + , + and + com::sun::star::sdbc::DataType::LONGVARCHAR + columns. + If the limit is exceeded, the excess data is silently discarded. + </p> + <p> + There is no limitation, if set to zero. + </p> + */ + [property] long MaxFieldSize; + + + /** retrieves the maximum number of rows that a ResultSet can contain. + If the limit is exceeded, the excess rows are silently dropped. + <br>There is no limitation, if set to zero. + */ + [property] long MaxRows; + + + /** defines the SQL cursor name that will be used by subsequent Statement + <code>execute</code> + methods. + <p> + This name can then be used in SQL positioned update/delete statements to + identify the current row in the ResultSet generated by this statement. If + the database does not support positioned update/delete, this property is + a noop. To ensure that a cursor has the proper isolation level to support + updates, the cursor's SELECT statement should be of the form + "select for update ...". If the "for update" phrase is omitted, + positioned updates may fail. + </p> + <P> + <B> + Note: + </B> + By definition, positioned update/delete + execution must be done by a different Statement than the one + which generated the ResultSet being used for positioning. Also, + cursor names must be unique within a connection. + </p> + */ + [property] string CursorName; + + + /** retrieves the result set concurrency. + @see com::sun::star::sdbc::ResultSetConcurrency + */ + [property] long ResultSetConcurrency; + + + /** Determine the result set type. + @see com::sun::star::sdbc::ResultSetType + */ + [property] long ResultSetType; + + + /** retrieves the direction for fetching rows from database tables + that is the default for result sets generated from this + <code>Statement</code> + object. + <p> + If this + <code>Statement</code> + object has not set a fetch direction, + the return value is implementation-specific. + </p> + */ + [property] long FetchDirection; + + + /** retrieves the number of result set rows that is the default fetch size + for result sets generated from this + <code>Statement</code> + object. + <p> + If this + <code>Statement</code> + object has not set a fetch size, + the return value is implementation-specific. + </p> + */ + [property] long FetchSize; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ProcedureColumn.idl b/offapi/com/sun/star/sdbc/ProcedureColumn.idl new file mode 100644 index 000000000..2ddcedb47 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ProcedureColumn.idl @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ProcedureColumn_idl__ +#define __com_sun_star_sdbc_ProcedureColumn_idl__ + + module com { module sun { module star { module sdbc { + + +/** indicates the type of a procedure column. + */ +published constants ProcedureColumn +{ + + /** indicates that the type of the column is unknown. A possible value for + the column + <code>COLUMN_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedureColumns(). + */ + const long UNKNOWN = 0; + + /** indicates that the column stores IN parameters. + A possible value for the column + <code>COLUMN_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedureColumns(). + */ + const long IN = 1; + + /** indicates that the column stores INOUT parameters. + A possible value for the column + <code>COLUMN_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedureColumns(). + */ + const long INOUT = 2; + + /** indicates that the column stores results. + A possible value for the column + <code>COLUMN_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedureColumns(). + */ + const long RESULT = 3; + + /** indicates that the column stores OUT parameters. + A possible value for the column + <code>COLUMN_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedureColumns(). + */ + const long OUT = 4; + + /** Indicates that the column stores return values. + A possible value for the column + <code>COLUMN_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedureColumns(). + */ + const long RETURN = 5; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ProcedureResult.idl b/offapi/com/sun/star/sdbc/ProcedureResult.idl new file mode 100644 index 000000000..bdd0ed2ee --- /dev/null +++ b/offapi/com/sun/star/sdbc/ProcedureResult.idl @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ProcedureResult_idl__ +#define __com_sun_star_sdbc_ProcedureResult_idl__ + + module com { module sun { module star { module sdbc { + + +/** determines whether a procedure returns a result or not. + */ +published constants ProcedureResult +{ + + /** A possible value for column + <code>PROCEDURE_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedures(). + <p> + Indicates that it is not known whether the procedure returns + a result. + </p> + */ + const long UNKNOWN = 0; + + /** A possible value for column + <code>PROCEDURE_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedures(). + <p> + Indicates that the procedure does not return + a result. + </p> + */ + const long NONE = 1; + + /** A possible value for column + <code>PROCEDURE_TYPE</code> + in the + com::sun::star::sdbc::XResultSet + object returned by the method + com::sun::star::sdbc::XDatabaseMetaData::getProcedures(). + <p> + Indicates that the procedure returns + a result. + </p> + */ + const long RETURN = 2; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ResultSet.idl b/offapi/com/sun/star/sdbc/ResultSet.idl new file mode 100644 index 000000000..69f1cd617 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ResultSet.idl @@ -0,0 +1,236 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ResultSet_idl__ +#define __com_sun_star_sdbc_ResultSet_idl__ + +#include <com/sun/star/lang/XComponent.idl> + +#include <com/sun/star/beans/XPropertySet.idl> + +#include <com/sun/star/util/XCancellable.idl> + + module com { module sun { module star { module sdbc { + + published interface XStatement; + published interface XRow; + published interface XRowUpdate; + published interface XResultSet; + published interface XResultSetUpdate; + published interface XResultSetMetaDataSupplier; + published interface XWarningsSupplier; + published interface XColumnLocate; + published interface XCloseable; + + +/** provides access to a table of data. A ResultSet + object is usually generated by executing a Statement. + + + + <p> + A ResultSet maintains a cursor pointing to its current row of + data. Initially the cursor is positioned before the first row. + The "next" method moves the cursor to the next row. + </p> + <p> + The getXXX methods retrieve column values for the current + row. You can retrieve values using either the index number of the + column. Columns are numbered from 1. + </p> + <p> + For maximum portability, ResultSet columns within each row should be + read in left-to-right order and each column should be read only once. + </p> + <p> + For the getXXX methods, the SDBC driver attempts to convert the + underlying data to the specified type and returns a suitable + value. + </p> + <p> + Column names used as input to the findColumn method are case + insensitive. When several columns have the same name, then the value + of the first matching column will be returned. The column name option is + designed to be used when column names are used in the SQL + query. For columns that are NOT explicitly named in the query, it + is best to use column numbers. If column names are used, there is + no way for the programmer to guarantee that they actually refer to + the intended columns. + </p> + <p> + A ResultSet is automatically closed (disposed) by the Statement that + generated it when that Statement is closed, re-executed, or used + to retrieve the next result from a sequence of multiple results. + </p> + <p> + The number, types, and properties of a ResultSet's columns are + provided by the ResultSetMetaData object returned by the getMetaData + method. + </p> + */ +published service ResultSet +{ + + /** optional for implementation; controls the releasing of resources + and the notification of registered listeners. + */ + [optional] interface com::sun::star::lang::XComponent; + + + /** freeing all resources of a result set. + + <p> + The creating statement will still be open after disposing. + </p> + + <p> + This interface is mandatory only for JDBC conformance, + otherwise it is optional. + </p> + */ + [optional] interface XCloseable; + + // gives access to the properties. + interface com::sun::star::beans::XPropertySet; + + + /** controls the chaining of warnings, which may occur on every call + to the connected database. + + <p> + Chained warnings from previous calls will be cleared before processing a new call. + </p> + + <p> + This interface is mandatory only for JDBC conformance, otherwise it is optional. + </p> + */ + [optional] interface XWarningsSupplier; + + + /** provides the access to the result set description. + */ + interface XResultSetMetaDataSupplier; + + + /** is the interface for navigating on the rows on a result set. + */ + interface XResultSet; + + + /** is the interface for updating row data to the database. + + <p> + The implementation is optional. + </p> + */ + [optional] interface XResultSetUpdate; + + + /** is the interface for accessing the data of the current row. + */ + interface XRow; + + + /** is used for locating a column by its name. + */ + interface XColumnLocate; + + + /** is the interface for updating the data of the current row. + + <p> + The implementation is optional. + </p> + */ + [optional] interface XRowUpdate; + + + /** defines the SQL cursor name that will be used by subsequent Statement + <code>execute</code> + methods. + + + <p> + This name can then be used in SQL positioned update/delete statements to + identify the current row in the ResultSet generated by this statement. If + the database doesn't support positioned update/delete, this property is + a noop. To ensure that a cursor has the proper isolation level to support + updates, the cursor's SELECT statement should be of the form + "select for update ...". If the "for update" phrase is omitted, + positioned updates may fail. + </p> + <p> + <b> + Note: + </b> + By definition, positioned update/delete + execution must be done by a different Statement than the one + which generated the ResultSet being used for positioning. Also, + cursor names must be unique within a connection. + </p> + */ + [optional, readonly, property] string CursorName; + + + /** retrieves the result set concurrency. + + @see com::sun::star::sdbc::ResultSetConcurrency + */ + [readonly, property] long ResultSetConcurrency; + + + /** determines the result set type. + + @see com::sun::star::sdbc::ResultSetType + */ + [readonly, property] long ResultSetType; + + + /** retrieves the direction for fetching rows from database tables + that is the default for result sets generated from this + com::sun::star::sdbcx::Statement + object. + <br/> + If this <code>Statement</code> object has not set a fetch direction, + the return value is implementation-specific. + */ + [property] long FetchDirection; + + + /** retrieves the number of result set rows that is the default fetch size + for result sets generated from this + com::sun::star::sdbcx::Statement + object. + <br/> + If this + com::sun::star::sdbcx::Statement + object has not set a fetch size, + the return value is implementation-specific. + */ + [property] long FetchSize; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ResultSetConcurrency.idl b/offapi/com/sun/star/sdbc/ResultSetConcurrency.idl new file mode 100644 index 000000000..5721b6091 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ResultSetConcurrency.idl @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ResultSetConcurrency_idl__ +#define __com_sun_star_sdbc_ResultSetConcurrency_idl__ + + module com { module sun { module star { module sdbc { + + +/** describes the different scroll capabilities of a result set. + */ +published constants ResultSetConcurrency +{ + + /** is the concurrency mode for a + com::sun::star::sdb::ResultSet + object that may NOT be updated. + */ + const long READ_ONLY = 1007; + + + /** is the concurrency mode for a + com::sun::star::sdb::ResultSet + object that may be updated. + */ + const long UPDATABLE = 1008; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/ResultSetType.idl b/offapi/com/sun/star/sdbc/ResultSetType.idl new file mode 100644 index 000000000..9398113c1 --- /dev/null +++ b/offapi/com/sun/star/sdbc/ResultSetType.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_ResultSetType_idl__ +#define __com_sun_star_sdbc_ResultSetType_idl__ + + module com { module sun { module star { module sdbc { + + +/** describes the different scroll capabilities of a result set. + */ +published constants ResultSetType +{ + + /** is the type for a + com::sun::star::sdb::ResultSet + object whose cursor may move only forward. + */ + const long FORWARD_ONLY = 1003; + + + /** is the type for a + com::sun::star::sdb::ResultSet + object that is scrollable + but generally not sensitive to changes made by others. + */ + const long SCROLL_INSENSITIVE = 1004; + + + /** is the type for a + com::sun::star::sdb::ResultSet + object that is scrollable + and generally sensitive to changes made by others. + */ + const long SCROLL_SENSITIVE = 1005; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/RowSet.idl b/offapi/com/sun/star/sdbc/RowSet.idl new file mode 100644 index 000000000..f8b918368 --- /dev/null +++ b/offapi/com/sun/star/sdbc/RowSet.idl @@ -0,0 +1,177 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_RowSet_idl__ +#define __com_sun_star_sdbc_RowSet_idl__ + +#include <com/sun/star/sdbc/ResultSet.idl> +#include <com/sun/star/sdbc/XColumnLocate.idl> + + module com { module sun { module star { module container { + published interface XNameAccess; +};};};}; + + module com { module sun { module star { module sdbc { + + published interface XRowSet; + published interface XParameters; + + +/** is a client side ResultSet, which combines the characteristics of a + com::sun::star::sdbc::Statement + and a + com::sun::star::sdbc::ResultSet. + + + <p> + It acts like a typical bean. Before you use the RowSet, you have to specify a + set of properties like a DataSource and a Command and other properties known of + Statement. + <br/> + Afterwards, you can populate the RowSet by its execute method to fill the set + with data. + </p> + <p> + On the one hand, a RowSet can be used as a short cut to retrieve the data of a DataSource. + You don't have to establish a connection, create a Statement, and then create + a ResultSet. On the other hand, a row set can be used to implement capabilities for + a result set, which are not supported by a driver result set, like caching + strategies or update capabilities. + </p> + */ +published service RowSet +{ + service com::sun::star::sdbc::ResultSet; + + /** used to execute and to add/remove listeners. + + <p>To refresh the content of a RowSet, use this interface's XRowSet::execute() + method.</p> + */ + interface XRowSet; + + // used to set parameters. + interface XParameters; + + /** allows locating columns whose name is known only. + */ + interface XColumnLocate; + + /** is the name of a named datasource to use.@see com::sun::star::sdbc:XDataSource + */ + [property] string DataSourceName; + + + /** is the connection URL. Could be used instead of the DataSourceName. + */ + [property] string URL; + + + /** is the command which should be executed. + */ + [property] string Command; + + + /** indicates the transaction isolation level, which should be used for the + connection.@see com::sun::star::sdbc::TransactionIsolation + */ + [property] long TransactionIsolation; + + + /** is the type map that will be used for the custom mapping of SQL structured types + and distinct types. + */ + [property] com::sun::star::container::XNameAccess TypeMap; + + + /** returns if escape processing is on or off. + If escape scanning is on (the default), the driver will do + escape substitution before sending the SQL to the database. + This is only evaluated, if the CommandType is COMMAND. + */ + [property] boolean EscapeProcessing; + + + /** retrieves the number of seconds the driver will wait for a Statement + to execute. If the limit is exceeded, a + com::sun::star::sdbc::SQLException + is thrown. + There is no limitation, if set to zero. + */ + [property] long QueryTimeOut; + + + /** returns the maximum number of bytes allowed for any column value. + + <p> + This limit is the maximum number of bytes that can be returned + for any column value. The limit applies only to + com::sun::star::sdbc::DataType::BINARY + , + com::sun::star::sdbc::DataType::VARBINARY + , + com::sun::star::sdbc::DataType::LONGVARBINARY + , + com::sun::star::sdbc::DataType::CHAR + , + com::sun::star::sdbc::DataType::VARCHAR + , + and + com::sun::star::sdbc::DataType::LONGVARCHAR + columns. + If the limit is exceeded, the excess data is silently discarded. + <br/> + There is no limitation, if set to zero. + </p> + */ + [property] long MaxFieldSize; + + + /** retrieves the maximum number of rows that a ResultSet can contain. + If the limit is exceeded, the excess rows are silently dropped. + <br/> + There is no limitation, if set to zero. + */ + [property] long MaxRows; + + + /** determines the user for whom to open the connection. + */ + [property] string User; + + + /** determines the user for whom to open the connection. + */ + [property] string Password; + + + /** determine the result set type. + + @see com::sun::star::sdbc::ResultSetType + */ + [property] long ResultSetType; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/SQLException.idl b/offapi/com/sun/star/sdbc/SQLException.idl new file mode 100644 index 000000000..bd2658334 --- /dev/null +++ b/offapi/com/sun/star/sdbc/SQLException.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#define __com_sun_star_sdbc_SQLException_idl__ + +#include <com/sun/star/uno/Exception.idl> + + module com { module sun { module star { module sdbc { + + +/** is an exception that provides information on a database access error. + + <p> + Each + com::sun::star::sdbc::SQLException + provides several kinds of information: + </p> + <p> + <ul> + <li> + a string describing the error. This is used as the + com::sun::star::uno::Exception + message. + </li> + </ul> + </p> + */ +published exception SQLException: com::sun::star::uno::Exception +{ + /** returns a string, which uses the XOPEN SQLState conventions. + The values of the SQLState string are described in the XOPEN SQL spec. + */ + string SQLState; + + /** returns an integer error code that is specific to each vendor. Normally this will + be the actual error code returned by the underlying database. + */ + long ErrorCode; + + /** returns a chain to the next Exception. + This can be used to provide additional + error information. + */ + any NextException; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/SQLWarning.idl b/offapi/com/sun/star/sdbc/SQLWarning.idl new file mode 100644 index 000000000..e13468e96 --- /dev/null +++ b/offapi/com/sun/star/sdbc/SQLWarning.idl @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_SQLWarning_idl__ +#define __com_sun_star_sdbc_SQLWarning_idl__ + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is an exception that provides information on database access + warnings. Warnings are silently chained to the object whose method + caused it to be reported. + + @see XConnection::getWarnings + @see XResultSet::getWarnings + @see XStatement::getWarnings + */ +published exception SQLWarning: SQLException +{ +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/Statement.idl b/offapi/com/sun/star/sdbc/Statement.idl new file mode 100644 index 000000000..6b7868f78 --- /dev/null +++ b/offapi/com/sun/star/sdbc/Statement.idl @@ -0,0 +1,220 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_Statement_idl__ +#define __com_sun_star_sdbc_Statement_idl__ + +#include <com/sun/star/lang/XComponent.idl> + +#include <com/sun/star/beans/XPropertySet.idl> + +#include <com/sun/star/util/XCancellable.idl> + + module com { module sun { module star { module sdbc { + + published interface XWarningsSupplier; + published interface XStatement; + published interface XBatchExecution; + published interface XMultipleResults; + published interface XCloseable; + + +/** is used for executing a static SQL statement and obtaining the results + produced by it. + + <p> + Only one ResultSet per Statement can be open at any point in + time. Therefore, if the reading of one ResultSet is interleaved + with the reading of another, each must have been generated by + different Statements. All statement <code>execute</code> methods implicitly + close a statement's current ResultSet if an open one exists. + </p> + */ +published service Statement +{ + + /** optional for implementation, controls the releasing of resources + and the notification of registered listeners. + */ + [optional] interface com::sun::star::lang::XComponent; + + + /** freeing all resources of a statement. A related result set will be + freed as well. + */ + interface XCloseable; + + // gives access to the properties. + interface com::sun::star::beans::XPropertySet; + + /** could be used for canceling the execution of SQL statements if both + the DBMS and the driver support aborting an SQL statement. + The implementation is optional. + */ + [optional] interface com::sun::star::util::XCancellable; + + /** is the interface for executing SQL commands. + */ + interface XStatement; + + + /** provides the ability of batch execution. This interface is optional + for execution. + <p> + A driver implementing batch execution must return + `TRUE` + for + com::sun::star::sdbc:: XDatabaseMetaData::supportsBatchUpdates() + </p> + */ + [optional] interface XBatchExecution; + + + /** controls the chaining of warnings, which may occur on every call + to the connected database. Chained warnings from previous calls will be + cleared before processing a new call. + */ + interface XWarningsSupplier; + + + /** covers the handling of multiple results after executing an SQL command. + The implementation is optional. + */ + [optional] interface XMultipleResults; + + + /** retrieves the number of seconds the driver will wait for a Statement + to execute. If the limit is exceeded, a SQLException is thrown. + There is no limitation, if set to zero. + */ + [property] long QueryTimeOut; + + + /** returns the maximum number of bytes allowed for any column value. + + <p> + This limit is the maximum number of bytes that can be returned + for any column value. The limit applies only to + com::sun::star::sdbc::DataType::BINARY + , + com::sun::star::sdbc::DataType::VARBINARY + , + com::sun::star::sdbc::DataType::LONGVARBINARY + , + com::sun::star::sdbc::DataType::CHAR + , + com::sun::star::sdbc::DataType::VARCHAR + , + and + com::sun::star::sdbc::DataType::LONGVARCHAR + columns. + If the limit is exceeded, the excess data is silently discarded. + <br/> + There is no limitation, if set to zero. + </p> + */ + [property] long MaxFieldSize; + + + /** retrieves the maximum number of rows that a ResultSet can contain. + If the limit is exceeded, the excess rows are silently dropped. + <br/> + There is no limitation, if set to zero. + */ + [property] long MaxRows; + + + /** defines the SQL cursor name that will be used by subsequent Statement + <code>execute</code> + methods. + + <p> + This name can then be used in SQL positioned update/delete statements to + identify the current row in the ResultSet generated by this statement. If + the database does not support positioned update/delete, this property is + a noop. To ensure that a cursor has the proper isolation level to support + updates, the cursor's SELECT statement should be of the form + "select for update ...". If the "for update" phrase is omitted, + positioned updates may fail. + </p> + <p> + <b> + Note: + </b> + By definition, positioned update/delete + execution must be done by a different Statement than the one + which generated the ResultSet being used for positioning. Also, + cursor names must be unique within a connection. + </p> + */ + [property] string CursorName; + + + /** retrieves the result set concurrency. + + @see com::sun::star::sdbc::ResultSetConcurrency + */ + [property] long ResultSetConcurrency; + + + /** determine the result set type. + + @see com::sun::star::sdbc::ResultSetType + */ + [property] long ResultSetType; + + + /** retrieves the direction for fetching rows from database tables + that is the default for result sets generated from this + <code>Statement</code> + object. + <br/> + If this + <code>Statement</code> + object has not set a fetch direction, + the return value is implementation-specific. + */ + [property] long FetchDirection; + + + /** retrieves the number of result set rows that is the default fetch size + for result sets generated from this + <code>Statement</code> + object. + <br/> + If this + <code>Statement</code> + object has not set a fetch size, + the return value is implementation-specific. + */ + [property] long FetchSize; + + + /** returns if escape processing is on or off. + If escape scanning is on (the default), the driver will do + escape substitution before sending the SQL to the database. + */ + [property] boolean EscapeProcessing; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/TransactionIsolation.idl b/offapi/com/sun/star/sdbc/TransactionIsolation.idl new file mode 100644 index 000000000..9f9c4c4ac --- /dev/null +++ b/offapi/com/sun/star/sdbc/TransactionIsolation.idl @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_TransactionIsolation_idl__ +#define __com_sun_star_sdbc_TransactionIsolation_idl__ + + module com { module sun { module star { module sdbc { + + +/** distinguishes different possible transaction isolation levels. + */ +published constants TransactionIsolation +{ + + /** indicates that transactions are not supported. + */ + const long NONE = 0; + + /** Dirty reads, non-repeatable reads and phantom reads can occur. + This level allows a row changed by one transaction to be read + by another transaction before any changes in that row have been + committed (a "dirty read"). If any of the changes are rolled back, + the second transaction will have retrieved an invalid row. + */ + const long READ_UNCOMMITTED = 1; + + /** Dirty reads are prevented; non-repeatable reads and phantom + reads can occur. This level only prohibits a transaction + from reading a row with uncommitted changes in it. + */ + const long READ_COMMITTED = 2; + + /** Dirty reads and non-repeatable reads are prevented; phantom + reads can occur. This level prohibits a transaction from + reading a row with uncommitted changes in it, and it also + prohibits the situation where one transaction reads a row, + a second transaction alters the row, and the first transaction + rereads the row, getting different values the second time + (a "non-repeatable read"). + */ + const long REPEATABLE_READ = 4; + + /** Dirty reads, non-repeatable reads and phantom reads are prevented. + This level includes the prohibitions in + <code>REPEATABLE_READ</code> + and further prohibits the + situation where one transaction reads all rows that satisfy + a WHERE condition, a second transaction inserts a row that + satisfies that WHERE condition, and the first transaction + rereads for the same condition, retrieving the additional + "phantom" row in the second read. + */ + const long SERIALIZABLE = 8; +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XArray.idl b/offapi/com/sun/star/sdbc/XArray.idl new file mode 100644 index 000000000..ddd0e461a --- /dev/null +++ b/offapi/com/sun/star/sdbc/XArray.idl @@ -0,0 +1,231 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XArray_idl__ +#define __com_sun_star_sdbc_XArray_idl__ + +#include <com/sun/star/uno/XInterface.idl> + + module com { module sun { module star { module container { + published interface XNameAccess; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XResultSet; + + +/** is used for mapping the SQL type com::sun::star::sdbc::DataType::ARRAY. + + By default, an <code>Array</code> is a transaction duration + reference to an SQL array. By default, an <code>Array</code> + is implemented using a SQL LOCATOR(array) internally. + */ +published interface XArray: com::sun::star::uno::XInterface +{ + + /** returns the SQL type name of the elements in + the array designated by this + <code>Array</code> + object. + <p> + If the elements are a built-in type, it returns + the database-specific type name of the elements. + If the elements are a user-defined type (UDT), + this method returns the fully-qualified SQL type name. + </p> + @returns + a String that is the database-specific name for a built-in base type or the fully-qualified SQL type name for a base type that is a UDT + + @throws SQLException + if a database access error occurs. + */ + string getBaseTypeName() raises (SQLException); + + + /** returns the SDBC type of the elements in the array designated + by this + <code>Array</code> + object. + @returns + a constant from the SDBC types that is the type code for the elements in the array designated by this Array object. + @throws SQLException + if a database access error occurs. + */ + long getBaseType() raises (SQLException); + + + /** retrieves the contents of the SQL array designated by this + <code>Array</code> + object, using the specified + <code>typeMap</code> + for type map customizations. + <p> + If the base type of the array does not match a user-defined type + in + <code>typeMap</code> + , the standard mapping is used instead. + + @param typeMap + is a map object that contains mappings of SQL type names to + services. If the + <code>typeMap</code> + is + `NULL` + , the type-map + associated with the connection for customizations of the type-mappings + is used. + + @returns + a sequence that contains the ordered elements + of the SQL array designated by this object. + + @throws SQLException + if an error occurs while attempting to access the array. + */ + sequence<any> getArray([in]com::sun::star::container::XNameAccess typeMap) + raises (SQLException); + + + /** returns an array containing a slice of the SQL array, beginning with the + specified + <code>index</code> + and containing up to + <code>count</code> + successive elements of the SQL array. + + @param index + is the array index of the first element to retrieve; + the first element is at index 1. + @param count + is the number of successive SQL array elements to retrieve. + @param typeMap + is a map object that contains mappings of SQL type names to + services. If the + <code>typeMap</code> + is + `NULL` + , the type-map + associated with the connection for customizations of the type-mappings + is used. + @returns + an array containing up to + <code>count</code> + consecutive elements of the SQL array, beginning with element + <code>index</code>. + @throws SQLException + if an error occurs while attempting to access the array. + */ + sequence<any> getArrayAtIndex([in]long index, + [in]long count, + [in]com::sun::star::container::XNameAccess + typeMap) + raises (SQLException); + + + /** returns a result set that contains the elements of the array + designated by this + <code>Array</code> + object and uses the given + <code>typeMap</code> + to map the array elements. If the base + type of the array does not match a user-defined type in + <code>typeMap</code> + or the + <code>typeMap</code> + is + `NULL` + , + the connection type mapping is used instead. + + + <p> + The result set contains one row for each array element, with + two columns in each row. The second column stores the element + value; the first column stores the index into the array for + that element (with the first array element being at index 1). + The rows are in ascending order corresponding to + the order of the indices. + </p> + + @param typeMap + contains mapping of SQL user-defined types to classes in the UNO programming language + @returns + a ResultSet object containing one row for each of the elements in the array designated by this Array object, + with the rows in ascending order based on the indices. + @throws SQLException + if a database access error occurs. + */ + XResultSet getResultSet([in]com::sun::star::container::XNameAccess typeMap) + raises (SQLException); + + + /** returns a result set holding the elements of the subarray that + starts at index + <code>index</code> + and contains up to + <code>count</code> + successive elements. This method uses the given + <code>typeMap</code> + to map the array elements. If the base + type of the array does not match a user-defined type in + <code>typeMap</code> + or the + <code>typeMap</code> + is + `NULL` + , + the connection type mapping is used instead. + + + <p> + The result set contains one row for each array element, with + two columns in each row. The second column stores the element + value; the first column stores the index into the array for + that element (with the first array element being at index 1). + The rows are in ascending order corresponding to + the order of the indices. + </p> + @param index + the array index of the first element to retrieve; the first element is at index 1. + @param count + the number of successive SQL array elements to retrieve, + @param typeMap + the Map object that contains the mapping of SQL type names to classes in the UNO programming language. + @returns + a ResultSet object containing up to count consecutive elements of the SQL array + designated by this Array object, starting at index index. + @throws SQLException + if a database access error occurs. + */ + XResultSet getResultSetAtIndex([in]long index, + [in]long count, + [in]com::sun::star::container::XNameAccess typeMap) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XBatchExecution.idl b/offapi/com/sun/star/sdbc/XBatchExecution.idl new file mode 100644 index 000000000..5ae75bfcf --- /dev/null +++ b/offapi/com/sun/star/sdbc/XBatchExecution.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XBatchExecution_idl__ +#define __com_sun_star_sdbc_XBatchExecution_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XResultSet; + + +/** is used for collecting and executing a set of SQL statements. + */ +published interface XBatchExecution: com::sun::star::uno::XInterface +{ + + /** adds a SQL command to the current batch of commands for the statement + object. + @param sql + the SQL statement which should be appended to the batch. + + @throws SQLException + if a database access error occurs. + */ + void addBatch([in]string sql ) raises (SQLException); + + /** makes the set of commands in the current batch empty. + @throws SQLException + if a database access error occurs. + */ + void clearBatch() raises (SQLException); + + /** submits a batch of commands to the database for execution. + @returns + an array of update counts containing one element for each + command in the batch. The array is ordered according to the order in + which commands were inserted into the batch. + @throws SQLException + if a database access error occurs. + */ + sequence<long> executeBatch() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XBlob.idl b/offapi/com/sun/star/sdbc/XBlob.idl new file mode 100644 index 000000000..f40f88074 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XBlob.idl @@ -0,0 +1,222 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XBlob_idl__ +#define __com_sun_star_sdbc_XBlob_idl__ + +#include <com/sun/star/uno/XInterface.idl> + + module com { module sun { module star { module io { + published interface XInputStream; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is the representation (mapping) of an SQL <i>BLOB</i>. + + <p> + A SQL + <i> + BLOB + </i> + is a built-in type that stores a + Binary Large Object as a column value in a row of a database table. + The driver implements + <i> + BLOB + </i> + using a + SQL + <code>locator(BLOB)</code> + , which means that a + <code>Blob</code> + object contains a logical pointer to the SQL + <i> + BLOB + </i> + data rather than the data itself. + <br/> + A + <code>Blob</code> + object is valid for the duration of the transaction in which is was created. + + </p> + <p> + Methods in the interfaces + com::sun::star::sdbc::XResultSet + , + and + com::sun::star::sdbc::XPreparedStatement + , such as + <code>getBlob</code> + and + <code>setBlob</code> + allow a programmer to access the SQL + <i>BLOB</i>. + <br/> + The + <code>Blob</code> + interface provides methods for getting the length of a SQL + <i> + BLOB + </i> + (Binary Large Object) value, for materializing a + <i> + BLOB + </i> + value on the client and for determining the position of a pattern of bytes within a + <i> + BLOB + </i> + value. + </p> + */ +published interface XBlob: com::sun::star::uno::XInterface +{ + + /** returns the number of bytes in the + <i> + BLOB + </i> + value + designated by this + <code>Blob</code> + object. + @returns + the length + @throws SQLException + if a database access error occurs. + */ + hyper length() raises (SQLException); + + + /** returns as an array of bytes part or all of the + <i> + BLOB + </i> + value that this + <code>Blob</code> + object designates. The byte + array contains up to + <code>length</code> + consecutive bytes + starting at position + <code>pos</code>. + @param pos + is the ordinal position of the first byte in the + <i> + BLOB + </i> + value to be extracted; the first byte is at + position 1. + @param length + is the number of consecutive bytes to be copied. + @returns + a byte array containing up to + <code>length</code> + consecutive bytes from the + <i> + BLOB + </i> + value designated + by this + <code>Blob</code> + object, starting with the byte at position + <code>pos</code>. + @throws SQLException + if there is an error accessing the <i>BLOB</i>. + */ + sequence<byte> getBytes([in]hyper pos, [in]long length) + raises (SQLException); + + + /** retrieves the + <i> + BLOB + </i> + designated by this + <code>Blob</code> + instance as a stream. + @returns + the stream + @throws SQLException + if a database access error occurs. + */ + com::sun::star::io::XInputStream getBinaryStream() + raises (SQLException); + + /** determines the byte position at which the specified byte + <code>pattern</code> + begins within the + <i> + BLOB + </i> + value that this + <code>Blob</code> + object represents. The + search for + <code>pattern</code> + begins at position <code>start</code>. + + @param pattern + the pattern to search + @param start + the start position for the search + @returns + the position + @throws SQLException + if a database access error occurs. + */ + hyper position([in]sequence<byte> pattern, [in]hyper start) + raises (SQLException); + + + /** determines the byte position in the + <i> + BLOB + </i> + value + designated by this + <code>Blob</code> + object at which + <code>pattern</code> + begins. The search begins at position <code>start</code>. + @param pattern + the pattern to search + @param start + position to start + @returns + the position + @throws SQLException + if a database access error occurs. + */ + hyper positionOfBlob([in]XBlob pattern,[in] hyper start) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XClob.idl b/offapi/com/sun/star/sdbc/XClob.idl new file mode 100644 index 000000000..045dfc981 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XClob.idl @@ -0,0 +1,189 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XClob_idl__ +#define __com_sun_star_sdbc_XClob_idl__ + +#include <com/sun/star/uno/XInterface.idl> + + module com { module sun { module star { module io { + published interface XInputStream; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is the mapping for the SQL + <code>CLOB</code> + type. + + + <p> + A SQL + <code>CLOB</code> + is a built-in type + that stores a Character Large Object as a column value in a row of + a database table. + The driver implements a + <code>Clob</code> + object using a SQL + <code>locator(CLOB)</code> + , which means that a + <code>Clob</code> + object + contains a logical pointer to the SQL + <code>CLOB</code> + data rather than + the data itself. A + <code>Clob</code> + object is valid for the duration + of the transaction in which it was created. + </p> + <p> + The + <code>Clob</code> + interface provides methods for getting the + length of a SQL + <code>CLOB</code> + (Character Large Object) value, + for materializing a + <code>CLOB</code> + value on the client, and for + searching for a substring or + <code>CLOB</code> + object within a + <code>CLOB</code> + value. + </p> + <p> + Methods in the interfaces + com::sun::star::sdbc::XResultSet + , + and + com::sun::star::sdbc::XPreparedStatement + , such as + <code>getClob</code> + and + <code>setClob</code> + allow a programmer to access the SQL <code>CLOB</code>. + </p> + */ +published interface XClob: com::sun::star::uno::XInterface +{ + + /** returns the number of characters in the + <code>CLOB</code> + value + designated by this + <code>Clob</code> + object. + @returns + the length of the CLOB object + @throws SQLException + if a database access error occurs. + */ + hyper length() raises (SQLException); + + + /** returns a copy of the specified substring in the + <code>Clob</code> + value + designated by this + <code>Clob</code> + object. + + + <p> + The substring begins at position <code>pos</code> and has up + to + <code>length</code> + consecutive characters. + </p> + @param pos + the starting position, 1-based + @param length + the length of the substring + @returns + the substring + @throws SQLException + if a database access error occurs. + */ + string getSubString([in]hyper pos, [in]long length) raises (SQLException); + + + /** gets the + <code>Clob</code> + contents as a stream. + @returns + the stream + @throws SQLException + if a database access error occurs. + */ + com::sun::star::io::XInputStream getCharacterStream() raises (SQLException); + + + /** determines the character position at which the specified substring + <code>searchstr</code> + appears in the + <code>Clob</code>. + The search begins at position <code>start</code>. + + @param searchstr + the string to search + @param start + the starting position + @returns + the length of the CLOB object + @throws SQLException + if a database access error occurs. + */ + hyper position([in]string searchstr, [in]long start) + raises (SQLException); + + + /** determines the position at which the specified + <code>Clob</code> + object + <code>pattern</code> + appears in this + <code>Clob</code> + object. + The search begins at position <code>start</code>. + @param pattern + the CLOB to search + @param start + the starting position + @returns + the position of the CLOB inside + @throws SQLException + if a database access error occurs. + */ + hyper positionOfClob([in]XClob pattern, [in]hyper start) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XCloseable.idl b/offapi/com/sun/star/sdbc/XCloseable.idl new file mode 100644 index 000000000..144f01563 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XCloseable.idl @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XCloseable_idl__ +#define __com_sun_star_sdbc_XCloseable_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** provides for the releasing of resources acquired by the implementing object. + */ +published interface XCloseable: com::sun::star::uno::XInterface +{ + + /** releases all resources connected to an object. + @throws SQLException + if a database access error occurs. + */ + void close() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XColumnLocate.idl b/offapi/com/sun/star/sdbc/XColumnLocate.idl new file mode 100644 index 000000000..626a17853 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XColumnLocate.idl @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XColumnLocate_idl__ +#define __com_sun_star_sdbc_XColumnLocate_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XResultSetMetaData; + + +/** provides the possibility to find columns by their name. + + + <p> + When several columns have the same name, then the value + of the first matching column will be returned. The column name option is + designed to be used when column names are used in the SQL + query. For columns that are NOT explicitly named in the query, it + is best to use column numbers. If column names are used, there is + no way for the programmer to guarantee that they actually refer to + the intended columns. + </p> + */ +published interface XColumnLocate: com::sun::star::uno::XInterface +{ + + /** maps the given ResultSet column name to its ResultSet column index. + + <p> + The specification before LibreOffice 4.2 left unspecified what should + happen for an invalid column name. As a result some drivers written + against the older specification may return a special invalid value, such + as a negative number, zero, or a number greater than the number of + columns. + </p> + + @param columnName + the name of the column + @returns + the position of the column + @throws SQLException + if the column named <code>columnName</code> does not exist, + or a database access error occurs. + */ + long findColumn([in]string columnName) raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XConnection.idl b/offapi/com/sun/star/sdbc/XConnection.idl new file mode 100644 index 000000000..3548ac187 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XConnection.idl @@ -0,0 +1,406 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XConnection_idl__ +#define __com_sun_star_sdbc_XConnection_idl__ + +#include <com/sun/star/uno/XInterface.idl> + + module com { module sun { module star { module container { + published interface XNameAccess; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + +#include <com/sun/star/sdbc/XCloseable.idl> + + module com { module sun { module star { module sdbc { + + published interface XStatement; + published interface XPreparedStatement; + published interface XDatabaseMetaData; + + +/** represents a connection (session) with a specific + database. Within the context of a Connection, SQL statements are + executed and results are returned. + + + <p> + A Connection's database is able to provide information + describing its tables, its supported SQL grammar, its stored + procedures, and the capabilities of this connection. This + information is obtained with the + com::sun::star::sdbc::XDatabaseMetaData::getMetaData() + method. + + </p> + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::XStatement + @see com::sun::star::sdbc::XDatabaseMetaData + */ +published interface XConnection: com::sun::star::sdbc::XCloseable +{ + + /** creates a new + com::sun::star::sdbc::Statement + object for sending SQL statements to the database. + + + <p> + SQL statements without parameters are normally + executed using Statement objects. If the same SQL statement + is executed many times, it is more efficient to use a + com::sun::star::sdbc::PreparedStatement. + </p> + <p> + Result sets created using the returned Statement will have + forward-only type, and read-only concurrency, by default. + </p> + <p> + Escape processing for the SQL-Statement is enabled, by default. + </p> + + @returns + a new Statement object + @throws SQLException + if a database access error occurs. + */ + XStatement createStatement() raises (SQLException); + + /** creates a + com::sun::star::sdbc::PreparedStatement + object for sending parameterized SQL statements to the database. + + + <p> + A SQL statement with or without IN parameters can be + pre-compiled and stored in a PreparedStatement object. This + object can then be used to efficiently execute this statement + multiple times. + + </p> + <p> + <b> + Note: + </b> + This method is optimized for handling + parametric SQL statements that benefit from precompilation. If + the driver supports precompilation, + the method + <code>prepareStatement</code> + will send + the statement to the database for precompilation. Some drivers + may not support precompilation. In this case, the statement may + not be sent to the database until the + com::sun::star::sdbc::PreparedStatement + is executed. This has no direct effect on users; however, it does + affect which method throws certain SQLExceptions. + </p> + <p> + Result sets created using the returned PreparedStatement will have + forward-only type and read-only concurrency, by default. + </p> + <p> + Escape processing for the SQL-Statement is enabled, by default. + </p> + + @param sql + a SQL statement that may contain one or more "?" IN parameter placeholders + @returns + a new PreparedStatement object containing the pre-compiled statement + @throws SQLException + if a database access error occurs. + */ + XPreparedStatement prepareStatement([in]string sql) raises (SQLException); + + /** creates a + com::sun::star::sdbc::CallableStatement + object for calling + database stored procedures. + + + <p> + The CallableStatement provides methods for setting up its IN and OUT + parameters, and methods for executing the call to a stored procedure. + </p> + <p> + <b> + Note: + </b> + This method is optimized for handling stored + procedure call statements. Some drivers may send the call + statement to the database when the method + <code>prepareCall</code> + is done; + <br/> + others may wait until the CallableStatement is executed. This has no + direct effect on users; however, it does affect which method + throws certain SQLExceptions. + Result sets created using the returned CallableStatement will have + forward-only type and read-only concurrency, by default. + </p> + + @param sql + a SQL statement that may contain one or more "?" IN parameter placeholders + @returns + a new PreparedStatement object containing the pre-compiled statement + @throws SQLException + if a database access error occurs. + */ + XPreparedStatement prepareCall([in]string sql) raises (SQLException); + + /** converts the given SQL statement into the system's native SQL grammar. + A driver may convert the JDBC SQL grammar into its system's + native SQL grammar prior to sending it; this method returns the + native form of the statement that the driver would have sent. + + @param sql + a SQL statement that may contain one or more "?" parameter placeholders + @returns + the native form of this statement + @throws SQLException + if a database access error occurs. + */ + string nativeSQL([in]string sql) raises (SQLException); + + /** sets this connection's auto-commit mode. + + + <p> + If a connection is in auto-commit mode, then all its SQL + statements will be executed and committed as individual + transactions. Otherwise, its SQL statements are grouped into + transactions that are terminated by a call to either + the method + com::sun::star::sdbc::XConnection::commit() + or the method + com::sun::star::sdbc::XConnection::rollback(). + By default, new connections are in auto-commit mode. + </p> + <p> + The commit occurs when the statement completes or the next + execute occurs, whichever comes first. In the case of + statements returning a ResultSet, the statement completes when + the last row of the ResultSet has been retrieved or the + ResultSet has been closed. In advanced cases, a single + statement may return multiple results as well as output + parameter values. In these cases the commit occurs when all results and + output parameter values have been retrieved. + </p> + + @param autoCommit + `TRUE` enables auto-commit; `FALSE` disables auto-commit. + @throws SQLException + if a database access error occurs. + */ + void setAutoCommit([in] boolean autoCommit) raises (SQLException); + + /** gets the current auto-commit state. + + @returns + the current state of auto-commit mode. + @throws SQLException + if a database access error occurs. + + @see setAutoCommit + */ + boolean getAutoCommit() raises (SQLException); + + /** makes all changes made since the previous commit/rollback + permanent and releases any database locks currently held + by the Connection. This method should be + used only when auto-commit mode has been disabled. + + @throws SQLException + if a database access error occurs. + + @see setAutoCommit + */ + void commit() raises (SQLException); + + /** drops all changes made since the previous + commit/rollback and releases any database locks currently held + by this Connection. This method should be used only when auto-commit has been disabled. + + @throws SQLException + if a database access error occurs. + + @see setAutoCommit + */ + void rollback() raises (SQLException); + + /** tests to see if a connection is closed. + + + <p> + <b> + Note: + </b> + A Connection is automatically closed if no one references it + anymore. Certain fatal errors also result in a closed Connection. + </p> + + @returns + `TRUE` if the connection is closed; `FALSE` if it's still open. + @throws SQLException + if a database access error occurs. + */ + boolean isClosed() raises (SQLException); + + /** gets the metadata regarding this connection's database. + + + <p> + A Connection's database is able to provide information + describing its tables, its supported SQL grammar, its stored + procedures, the capabilities of this connection, and so on. This + information is made available through a DatabaseMetaData + object. + </p> + + @returns + a DatabaseMetaData object for this Connection. + @throws SQLException + if a database access error occurs. + */ + XDatabaseMetaData getMetaData() raises (SQLException); + + /** puts this connection in read-only mode as a hint to enable + database optimizations. + + + <p> + <b> + Note: + </b> + This method cannot be called while in the + middle of a transaction. Calling setReadOnly with + `TRUE` + does not + necessarily cause writes to be prohibited. + </p> + + @param readOnly + `TRUE` enables read-only mode; `FALSE` disables read-only mode. + @throws SQLException + if a database access error occurs. + */ + void setReadOnly([in]boolean readOnly) raises (SQLException); + + /** tests to see if the connection is in read-only mode. + @returns + `TRUE` if connection is read-only and `FALSE` otherwise. + @throws SQLException + if a database access error occurs. + */ + boolean isReadOnly() raises (SQLException); + + /** sets a catalog name in order to select + a subspace of this Connection's database in which to work. + If the driver does not support catalogs, it will + silently ignore this request. + @param catalog + the name of the catalog. + @throws SQLException + if a database access error occurs. + */ + void setCatalog([in]string catalog) raises (SQLException); + + /** returns the Connection's current catalog name. + @returns + the current catalog name or an empty string. + @throws SQLException + if a database access error occurs. + */ + string getCatalog() raises (SQLException); + + /** attempts to change the transaction isolation level to the one given. + + + <p> + The constants defined in + com::sun::star::sdbc::TransactionIsolation + are the possible transaction isolation levels. + </p> + <p> + <b> + Note: + </b> + This method cannot be called while + in the middle of a transaction. + </p> + @param level + one of the TransactionIsolation values with the exception of NONE; some databases may not support other values. + @throws SQLException + if a database access error occurs. + + @see com::sun::star::sdbc::XDatabaseMetaData::supportsTransactionIsolationLevel() + */ + void setTransactionIsolation([in]long level) raises (SQLException); + + /** gets this Connection's current transaction isolation level. + @returns + the current TransactionIsolation mode value. + @throws SQLException + if a database access error occurs. + */ + long getTransactionIsolation() raises (SQLException); + + /** gets the type map object associated with this connection. Only drivers + which implement the custom type mapping facility will return an object otherwise + NULL could be returned. + + <p> + Unless the application has added an entry to the type map, the map + returned will be empty. + </p> + @returns + the XNameAccess object associated with this Connection object. + + @throws SQLException + if a database access error occurs. + */ + com::sun::star::container::XNameAccess getTypeMap() raises (SQLException); + + /** installs the given type map as the type map for this connection. + The type map will be used for the custom mapping of SQL structured types + and distinct types. + + + <p> + Only if the driver supports custom type mapping is the setting of a map allowed. + </p> + + @param typeMap + set the XNameAccess object associated with this Connection object. + @throws SQLException + if a database access error occurs. + */ + void setTypeMap([in]com::sun::star::container::XNameAccess typeMap) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XConnectionPool.idl b/offapi/com/sun/star/sdbc/XConnectionPool.idl new file mode 100644 index 000000000..2cb87f5d7 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XConnectionPool.idl @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XConnectionPool_idl__ +#define __com_sun_star_sdbc_XConnectionPool_idl__ + +#include <com/sun/star/sdbc/XDriverManager.idl> +#include <com/sun/star/sdbc/XDriverAccess.idl> + +module com { module sun { module star { module sdbc { + +/* + @since LibreOffice 4.1 +*/ +published interface XConnectionPool +{ + interface XDriverManager; + interface XDriverAccess; +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XDataSource.idl b/offapi/com/sun/star/sdbc/XDataSource.idl new file mode 100644 index 000000000..c169b8972 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XDataSource.idl @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XDataSource_idl__ +#define __com_sun_star_sdbc_XDataSource_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; + + +/** is used for establishing connections via a factory which is identified + by its name. A DataSource object is typically registered by a naming service + provider. + */ +published interface XDataSource: com::sun::star::uno::XInterface +{ + + /** attempts to establish a database connection. + @param user + the user name + @param password + the password + @returns + the connection object + @throws SQLException + if a database access error occurs. + */ + XConnection getConnection([in]string user, [in]string password) + raises (SQLException); + + /** sets the maximum time in seconds that this data source will wait + while attempting to connect to a database. + + + <p> + A value of zero specifies that the timeout is the default system + timeout if there is one; otherwise, it specifies that there is no timeout. + When a DataSource object is created the login timeout is initially zero. + </p> + @param seconds + the login time limit in seconds + @throws SQLException + if a database access error occurs. + */ + void setLoginTimeout([in]long seconds) + raises (SQLException); + + /** gets the maximum time in seconds that this data source can wait + while attempting to connect to a database. + + + <p> + A value of zero means that the timeout is the default system timeout + if there is one; otherwise, it means that there is no timeout. When a + DataSource object is created the login timeout is initially zero. + </p> + @returns + the login time limit in seconds + @throws SQLException + if a database access error occurs. + */ + long getLoginTimeout() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XDatabaseMetaData.idl b/offapi/com/sun/star/sdbc/XDatabaseMetaData.idl new file mode 100644 index 000000000..f1e0f327c --- /dev/null +++ b/offapi/com/sun/star/sdbc/XDatabaseMetaData.idl @@ -0,0 +1,2443 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XDatabaseMetaData_idl__ +#define __com_sun_star_sdbc_XDatabaseMetaData_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + + module com { module sun { module star { module sdbc { + + published interface XResultSet; + published interface XConnection; + +/** provides comprehensive information about the database as a whole. + + + <p>Many of the methods here return lists of information in + the form of + com::sun::star::sdbc::XResultSet + objects. + You can use the normal com::sun::star::sdbc::XRow + (or com::sun::star::sdb::XColumn) + methods such as + com::sun::star::sdbc::XRow::getString() + and + com::sun::star::sdbc::XRow::getInt() + to retrieve the data from these XResultSets. If a given form of + metadata is not available, these methods should throw a + com::sun::star::sdbc::SQLException. + After calling one of the getXXX() methods, + one can check whether that value is `NULL` + with the method com::sun::star::sdbc::XRow::wasNull(). + In the text only "(may be `NULL`)" is mentioned for this case. + </p> + <p>Some of these methods take arguments that are String patterns. These + arguments all have names such as fooPattern. Within a pattern String, "%" + means match any substring of 0 or more characters, and "_" means match + any one character. Only metadata entries matching the search pattern + are returned. If a search pattern argument is set to `VOID`, + that argument's criteria will be dropped from the search. + </p> + <p> + A + com::sun::star::sdbc::SQLException + will be thrown if a driver does not support + a metadata method. In the case of methods that return an XResultSet, + either an XResultSet (which may be empty) is returned or a + SQLException is thrown.</p> + */ +published interface XDatabaseMetaData: com::sun::star::uno::XInterface +{ + + /** Can all the procedures returned by getProcedures be called by the + current user? + + @return + `TRUE` + if the user is allowed to call all procedures returned by getProcedures + otherwise `FALSE`. + @throws SQLException + if a database access error occurs. + */ + boolean allProceduresAreCallable() raises (SQLException); + + /** Can all the tables returned by getTable be SELECTed by the + current user? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean allTablesAreSelectable() raises (SQLException); + + /** returns the URL for the database connection + */ + string getURL() raises (SQLException); + + /** returns the user name from this database connection. + */ + string getUserName() raises (SQLException); + + /** checks if the database in read-only mode. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isReadOnly() raises (SQLException); + + /** Are NULL values sorted high? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean nullsAreSortedHigh() raises (SQLException); + + /** Are NULL values sorted low? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean nullsAreSortedLow() raises (SQLException); + + /** Are NULL values sorted at the start regardless of sort order? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean nullsAreSortedAtStart() raises (SQLException); + + /** Are NULL values sorted at the end, regardless of sort order? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean nullsAreSortedAtEnd() raises (SQLException); + + /** returns the name of the database product. + */ + string getDatabaseProductName() raises (SQLException); + + /** returns the version of the database product. + */ + string getDatabaseProductVersion() raises (SQLException); + + /** returns the name of the SDBC driver. + */ + string getDriverName() raises (SQLException); + + /** returns the version number of the SDBC driver. + */ + string getDriverVersion() raises (SQLException); + + /** returns the SDBC driver major version number. + */ + long getDriverMajorVersion(); + + /** returns the SDBC driver minor version number. + */ + long getDriverMinorVersion(); + + /** use the database local files to save the tables. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean usesLocalFiles() raises (SQLException); + + /** use the database one local file to save for each table. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean usesLocalFilePerTable() raises (SQLException); + + /** use the database "mixed case unquoted SQL identifiers" case sensitive. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsMixedCaseIdentifiers() raises (SQLException); + + /** Does the database treat mixed case unquoted SQL identifiers as + case insensitive and store them in upper case? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean storesUpperCaseIdentifiers() raises (SQLException); + + /** Does the database treat mixed case unquoted SQL identifiers as + case insensitive and store them in lower case? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean storesLowerCaseIdentifiers() raises (SQLException); + + /** Does the database treat mixed case unquoted SQL identifiers as + case insensitive and store them in mixed case? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean storesMixedCaseIdentifiers() raises (SQLException); + + /** Does the database treat mixed case quoted SQL identifiers as + case sensitive and as a result store them in mixed case? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsMixedCaseQuotedIdentifiers() raises (SQLException); + + /** Does the database treat mixed case quoted SQL identifiers as + case insensitive and store them in upper case? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean storesUpperCaseQuotedIdentifiers() raises (SQLException); + + /** Does the database treat mixed case quoted SQL identifiers as + case insensitive and store them in lower case? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean storesLowerCaseQuotedIdentifiers() raises (SQLException); + + /** Does the database treat mixed case quoted SQL identifiers as + case insensitive and store them in mixed case? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean storesMixedCaseQuotedIdentifiers() raises (SQLException); + + /** What's the string used to quote SQL identifiers? + This returns a space " " if identifier quoting is not supported. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getIdentifierQuoteString() raises (SQLException); + + /** gets a comma-separated list of all a database's SQL keywords + that are NOT also SQL92 keywords. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getSQLKeywords() raises (SQLException); + + /** gets a comma-separated list of math functions. These are the + X/Open CLI math function names used in the SDBC function escape + clause. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getNumericFunctions() raises (SQLException); + + /** gets a comma-separated list of string functions. These are the + X/Open CLI string function names used in the SDBC function escape + clause. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getStringFunctions() raises (SQLException); + + /** gets a comma-separated list of system functions. These are the + X/Open CLI system function names used in the SDBC function escape + clause. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getSystemFunctions() raises (SQLException); + + /** gets a comma-separated list of time and date functions. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getTimeDateFunctions() raises (SQLException); + + /** gets the string that can be used to escape wildcard characters. + This is the string that can be used to escape "_" or "%" in + the string pattern style catalog search parameters. + + + <p> + The "_" character represents any single character. + </p> + <p> + The "%" character represents any sequence of zero or + more characters. + </p> + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getSearchStringEscape() raises (SQLException); + + /** gets all the "extra" characters that can be used in unquoted + identifier names (those beyond a-z, A-Z, 0-9 and _). + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getExtraNameCharacters() raises (SQLException); + + /** support the Database "ALTER TABLE" with add column? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsAlterTableWithAddColumn() raises (SQLException); + + /** support the Database "ALTER TABLE" with drop column? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsAlterTableWithDropColumn() raises (SQLException); + + /** support the Database column aliasing? + + + <p> + The SQL AS clause can be used to provide names for + computed columns or to provide alias names for columns as required. + </p> + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsColumnAliasing() raises (SQLException); + + /** are concatenations between NULL and non-NULL values NULL? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean nullPlusNonNullIsNull() raises (SQLException); + + /** `TRUE` + , if the Database supports the CONVERT function between SQL types, + otherwise `FALSE`. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsTypeConversion() raises (SQLException); + + /** `TRUE` + , if the Database supports the CONVERT between the given SQL types + otherwise `FALSE`. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsConvert([in]long fromType, [in]long toType) + raises (SQLException); + + /** Are table correlation names supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsTableCorrelationNames() raises (SQLException); + + /** If table correlation names are supported, are they restricted + to be different from the names of the tables? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsDifferentTableCorrelationNames() + raises (SQLException); + + /** Are expressions in "ORDER BY" lists supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsExpressionsInOrderBy() raises (SQLException); + + /** Can an "ORDER BY" clause use columns not in the SELECT statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsOrderByUnrelated() raises (SQLException); + + /** Is some form of "GROUP BY" clause supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsGroupBy() raises (SQLException); + + /** Can a "GROUP BY" clause use columns not in the SELECT? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsGroupByUnrelated() raises (SQLException); + + /** Can a "GROUP BY" clause add columns not in the SELECT + provided it specifies all the columns in the SELECT? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsGroupByBeyondSelect() raises (SQLException); + + /** Is the escape character in "LIKE" clauses supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsLikeEscapeClause() raises (SQLException); + + /** Are multiple XResultSets from a single execute supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsMultipleResultSets() raises (SQLException); + + /** Can we have multiple transactions open at once (on different + connections)? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsMultipleTransactions() raises (SQLException); + + /** Can columns be defined as non-nullable? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsNonNullableColumns() raises (SQLException); + + /** `TRUE`, if the database supports ODBC Minimum SQL grammar, + otherwise `FALSE`. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsMinimumSQLGrammar() raises (SQLException); + + /** `TRUE`, if the database supports ODBC Core SQL grammar, + otherwise `FALSE`. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsCoreSQLGrammar() raises (SQLException); + + /** + `TRUE`, if the database supports ODBC Extended SQL grammar, + otherwise `FALSE`. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsExtendedSQLGrammar() raises (SQLException); + + /** @returns + `TRUE`, if the database supports ANSI92 entry level SQL grammar, + otherwise `FALSE`. + @throws SQLException + if a database access error occurs. + */ + boolean supportsANSI92EntryLevelSQL() raises (SQLException); + + /** @returns + `TRUE`, if the database supports ANSI92 intermediate SQL grammar, + otherwise `FALSE`. + @throws SQLException + if a database access error occurs. + */ + boolean supportsANSI92IntermediateSQL() raises (SQLException); + + /** @returns + `TRUE`, if the database supports ANSI92 full SQL grammar, + otherwise `FALSE`. + @throws SQLException + if a database access error occurs. + */ + boolean supportsANSI92FullSQL() raises (SQLException); + + /** returns + `TRUE`, if the Database supports SQL Integrity Enhancement Facility, + otherwise `FALSE`. + @throws SQLException + if a database access error occurs. + */ + boolean supportsIntegrityEnhancementFacility() raises (SQLException); + + /** @returns + `TRUE`, if some form of outer join is supported, + otherwise `FALSE`. + @throws SQLException + if a database access error occurs. + */ + boolean supportsOuterJoins() raises (SQLException); + + /** @returns + `TRUE`, if full nested outer joins are supported, + otherwise `FALSE`. + @throws SQLException + if a database access error occurs. + */ + boolean supportsFullOuterJoins() raises (SQLException); + + /** @returns + `TRUE`, if there is limited support for outer joins. + (This will be `TRUE` if supportFullOuterJoins is `TRUE`.) + `FALSE` is returned otherwise. + @throws SQLException + if a database access error occurs. + */ + boolean supportsLimitedOuterJoins() raises (SQLException); + + /** return the database vendor's preferred term for "schema" + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getSchemaTerm() raises (SQLException); + + /** return the database vendor's preferred term for "procedure" + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getProcedureTerm() raises (SQLException); + + /** return the database vendor's preferred term for "catalog" + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getCatalogTerm() raises (SQLException); + + /** Does a catalog appear at the start of a qualified table name? + (Otherwise it appears at the end) + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isCatalogAtStart() raises (SQLException); + + /** return the separator between catalog and table name + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + string getCatalogSeparator() raises (SQLException); + + /** Can a schema name be used in a data manipulation statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSchemasInDataManipulation() raises (SQLException); + + /** Can a schema name be used in a procedure call statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSchemasInProcedureCalls() raises (SQLException); + + /** Can a schema name be used in a table definition statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSchemasInTableDefinitions() raises (SQLException); + + /** Can a schema name be used in an index definition statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSchemasInIndexDefinitions() raises (SQLException); + + /** Can a schema name be used in a privilege definition statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSchemasInPrivilegeDefinitions() + raises (SQLException); + + /** Can a catalog name be used in a data manipulation statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsCatalogsInDataManipulation() raises (SQLException); + + /** Can a catalog name be used in a procedure call statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsCatalogsInProcedureCalls() raises (SQLException); + + /** Can a catalog name be used in a table definition statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsCatalogsInTableDefinitions() raises (SQLException); + + /** Can a catalog name be used in an index definition statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsCatalogsInIndexDefinitions() raises (SQLException); + + /** Can a catalog name be used in a privilege definition statement? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsCatalogsInPrivilegeDefinitions() + raises (SQLException); + + /** Is positioned DELETE supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsPositionedDelete() raises (SQLException); + + /** Is positioned UPDATE supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsPositionedUpdate() raises (SQLException); + + /** Is SELECT for UPDATE supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSelectForUpdate() raises (SQLException); + + /** Are stored procedure calls using the stored procedure escape + syntax supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsStoredProcedures() raises (SQLException); + + /** Are subqueries in comparison expressions supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSubqueriesInComparisons() raises (SQLException); + + /** Are subqueries in "exists" expressions supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSubqueriesInExists() raises (SQLException); + + /** Are subqueries in "in" statements supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSubqueriesInIns() raises (SQLException); + + /** Are subqueries in quantified expressions supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsSubqueriesInQuantifieds() raises (SQLException); + + /** Are correlated subqueries supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsCorrelatedSubqueries() raises (SQLException); + + /** Is SQL UNION supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsUnion() raises (SQLException); + + /** Is SQL UNION ALL supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsUnionAll() raises (SQLException); + + /** Can cursors remain open across commits? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsOpenCursorsAcrossCommit() raises (SQLException); + + /** Can cursors remain open across rollbacks? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsOpenCursorsAcrossRollback() raises (SQLException); + + /** Can statements remain open across commits? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsOpenStatementsAcrossCommit() raises (SQLException); + + /** Can statements remain open across rollbacks? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsOpenStatementsAcrossRollback() + raises (SQLException); + + /** return the maximal number of hex characters in an inline binary literal + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxBinaryLiteralLength() raises (SQLException); + + /** return the max length for a character literal + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxCharLiteralLength() raises (SQLException); + + /** return the limit on column name length + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxColumnNameLength() raises (SQLException); + + /** return the maximum number of columns in a "GROUP BY" clause + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxColumnsInGroupBy() raises (SQLException); + + /** return the maximum number of columns allowed in an index + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxColumnsInIndex() raises (SQLException); + + /** return the maximum number of columns in an "ORDER BY" clause + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxColumnsInOrderBy() raises (SQLException); + + /** return the maximum number of columns in a "SELECT" list + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxColumnsInSelect() raises (SQLException); + + /** return the maximum number of columns in a table + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxColumnsInTable() raises (SQLException); + + /** return the number of active connections at a time to this database. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxConnections() raises (SQLException); + + /** return the maximum cursor name length + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxCursorNameLength() raises (SQLException); + + /** return the maximum length of an index (in bytes) + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxIndexLength() raises (SQLException); + + /** return the maximum length allowed for a schema name + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxSchemaNameLength() raises (SQLException); + + /** return the maximum length of a procedure name + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxProcedureNameLength() raises (SQLException); + + /** return the maximum length of a catalog name + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxCatalogNameLength() raises (SQLException); + + /** return the maximum length of a single row. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxRowSize() raises (SQLException); + + /** Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY + blobs? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean doesMaxRowSizeIncludeBlobs() raises (SQLException); + + /** return the maximum length of a SQL statement + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxStatementLength() raises (SQLException); + + /** return the maximal number of open active statements at one time to this database + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxStatements() raises (SQLException); + + /** return the maximum length of a table name + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxTableNameLength() raises (SQLException); + + /** return the maximum number of tables in a SELECT statement + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxTablesInSelect() raises (SQLException); + + /** return the maximum length of a user name + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long getMaxUserNameLength() raises (SQLException); + + /** return the database default transaction isolation level. + The values are defined in + com::sun::star::sdbc::TransactionIsolation. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + @see com::sun::star::sdbc::XConnection + */ + long getDefaultTransactionIsolation() raises (SQLException); + + /** support the Database transactions? + If not, invoking the method + com::sun::star::sdbc::XConnection::commit() + is a noop and the + isolation level is TransactionIsolation_NONE. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsTransactions() raises (SQLException); + + /** Does this database support the given transaction isolation level? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + @see com::sun::star::sdbc::Connection + */ + boolean supportsTransactionIsolationLevel([in]long level) + raises (SQLException); + + /** support the Database both data definition and data manipulation statements + within a transaction? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. +<!-- JRH: Unclear on the intent of these many support questions. + If asking, it should state, "Does the Database support both...? + If declaring, it should state something like the following: + + metadata: supportsDataDefinitionAndDataManipulationTransactions + + "provides support for both data definition and data manipulation statements within a transaction." + --> */ + boolean supportsDataDefinitionAndDataManipulationTransactions() + raises (SQLException); + + /** are only data manipulation statements within a transaction + supported? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsDataManipulationTransactionsOnly() + raises (SQLException); + + /** does a data definition statement within a transaction force the + transaction to commit? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean dataDefinitionCausesTransactionCommit() + raises (SQLException); + + /** is a data definition statement within a transaction ignored? + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean dataDefinitionIgnoredInTransactions() + raises (SQLException); + + /** Gets a description of the stored procedures available in a + catalog. + + + <p> + Only procedure descriptions matching the schema and + procedure name criteria are returned. They are ordered by + PROCEDURE_SCHEM, and PROCEDURE_NAME. + </p> + <p> + Each procedure description has the following columns: + </p> + <ol> + <li> + <b>PROCEDURE_CAT</b> string => procedure catalog (may be `NULL`) + </li> + <li> + <b>PROCEDURE_SCHEM</b> string => procedure schema (may be `NULL`) + </li> + <li> + <b>PROCEDURE_NAME</b> string => procedure name + </li> + <li> reserved for future use + </li> + <li> reserved for future use + </li> + <li> reserved for future use + </li> + <li> + <b>REMARKS</b> string => explanatory comment on the procedure + </li> + <li> + <b>PROCEDURE_TYPE</b> short => kind of procedure: + <ul> + <li> UNKNOWN - May return a result + </li> + <li> NO - Does not return a result + </li> + <li> RETURN - Returns a result + </li> + </ul> + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schemaPattern + a schema name pattern; "" retrieves those without a schema + @param procedureNamePattern + a procedure name pattern + @returns + each row is a procedure description + @throws SQLException + if a database access error occurs. + */ + XResultSet getProcedures([in]any catalog, [in]string schemaPattern, + [in]string procedureNamePattern) raises (SQLException); + + /** gets a description of a catalog's stored procedure parameters + and result columns. + + + <p> + Only descriptions matching the schema, procedure and + parameter name criteria are returned. They are ordered by + PROCEDURE_SCHEM and PROCEDURE_NAME. Within this, the return value, + if any, is first. Next are the parameter descriptions in call + order. The column descriptions follow in column number order. + </p> + <p>Each row in the XResultSet is a parameter description or + column description with the following fields: + </p> + <ol> + <li> + <b>PROCEDURE_CAT</b> string => procedure catalog (may be `NULL`) + </li> + <li> + <b>PROCEDURE_SCHEM</b> string => procedure schema (may be `NULL`) + </li> + <li> + <b>PROCEDURE_NAME</b> string => procedure name + </li> + <li> + <b>COLUMN_NAME</b> string => column/parameter name + </li> + <li> + <b>COLUMN_TYPE</b> Short => kind of column/parameter: + <ul> + <li> UNKNOWN - nobody knows + </li> + <li> IN - IN parameter + </li> + <li> INOUT - INOUT parameter + </li> + <li> OUT - OUT parameter + </li> + <li> RETURN - procedure return value + </li> + <li> RESULT - result column in XResultSet + </li> + </ul> + </li> + <li> + <b>DATA_TYPE</b> short => SQL type from java.sql.Types + </li> + <li> + <b>TYPE_NAME</b> string => SQL type name, for a UDT type the + type name is fully qualified + </li> + <li> + <b>PRECISION</b> long => precision + </li> + <li> + <b>LENGTH</b> long => length in bytes of data + </li> + <li> + <b>SCALE</b> short => scale + </li> + <li> + <b>RADIX</b> short => radix + </li> + <li> + <b>NULLABLE</b> short => can it contain NULL? + <ul> + <li> NO_NULLS - does not allow NULL values + </li> + <li> NULLABLE - allows NULL values + </li> + <li> NULLABLE_UNKNOWN - nullability unknown + </li> + </ul> + </li> + <li> + <b>REMARKS</b> string => comment describing parameter/column + </li> + </ol> + <p> + <b>Note:</b> Some databases may not return the column + descriptions for a procedure. Additional columns beyond + REMARKS can be defined by the database. + </p> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schemaPattern + a schema name pattern; "" retrieves those without a schema + @param procedureNamePattern + a procedure name pattern + @param columnNamePattern + a column name pattern + @returns + each row describes a stored procedure parameter or column + @throws SQLException + if a database access error occurs. + */ + XResultSet getProcedureColumns([in]any catalog, [in]string schemaPattern, + [in]string procedureNamePattern, + [in]string columnNamePattern) + raises (SQLException); + + /** gets a description of tables available in a catalog. + + + <p>Only table descriptions matching the catalog, schema, table + name, and type criteria are returned. They are ordered by + TABLE_TYPE, TABLE_SCHEM, and TABLE_NAME. + </p> + <p>Each table description has the following columns: + </p> + <ol> + <li> + <b>TABLE_CAT</b> string => table catalog (may be `NULL`) + </li> + <li> + <b>TABLE_SCHEM</b> string => table schema (may be `NULL`) + </li> + <li> + <b>TABLE_NAME</b> string => table name + </li> + <li> + <b>TABLE_TYPE</b> string => table type. Typical types are "TABLE", + "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", + "LOCAL TEMPORARY", "ALIAS", "SYNONYM". + </li> + <li> + <b>REMARKS</b> string => explanatory comment on the table + </li> + </ol> + <p> + <b>Note:</b> Some databases may not return information for + all tables. + </p> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schemaPattern + a schema name pattern; "" retrieves those without a schema + @param tableNamePattern + a table name pattern + @param types + a list of table types to include + @returns + each row is a table description + @throws SQLException + if a database access error occurs. + */ + XResultSet getTables([in]any catalog, [in]string schemaPattern, + [in]string tableNamePattern, [in]sequence<string> types) + raises (SQLException); + + /** Gets the schema names available in this database. The results + are ordered by schema name. + + + <p>The schema column is: + </p> + <ol> + <li> + <b>TABLE_SCHEM</b> string => schema name + </li> + </ol> + @returns + each row has a single String column that is a schema name + @throws SQLException + if a database access error occurs. + */ + XResultSet getSchemas() raises (SQLException); + + /** gets the catalog names available in this database. The results + are ordered by catalog name. + + + <p>The catalog column is: + </p> + <ol> + <li> + <b>TABLE_CAT</b> string => catalog name + </li> + </ol> + @returns + each row has a single String column that is a catalog name + @throws SQLException + if a database access error occurs. + */ + XResultSet getCatalogs() raises (SQLException); + + /** gets the table types available in this database. The results + are ordered by table type. + + + <p>The table type is: + </p> + <ol> + <li> + <b>TABLE_TYPE</b> string => table type. Typical types are "TABLE", + "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", + "LOCAL TEMPORARY", "ALIAS", "SYNONYM". + </li> + </ol> + @returns + each row has a single String column that is a table type + @throws SQLException + if a database access error occurs. + */ + XResultSet getTableTypes() raises (SQLException); + + /** gets a description of table columns available in + the specified catalog. + + + <p>Only column descriptions matching the catalog, schema, table + and column name criteria are returned. They are ordered by + TABLE_SCHEM, TABLE_NAME, and ORDINAL_POSITION. + </p> + <p>Each column description has the following columns: + </p> + <ol> + <li> + <b>TABLE_CAT</b> string => table catalog (may be `NULL`) + </li> + <li> + <b>TABLE_SCHEM</b> string => table schema (may be `NULL`) + </li> + <li> + <b>TABLE_NAME</b> string => table name + </li> + <li> + <b>COLUMN_NAME</b> string => column name + </li> + <li> + <b>DATA_TYPE</b> short => SQL type from java.sql.Types + </li> + <li> + <b>TYPE_NAME</b> string => Data source dependent type name, + for a UDT the type name is fully qualified + </li> + <li> + <b>COLUMN_SIZE</b> long => column size. For char or date + types this is the maximum number of characters, for numeric or + decimal types this is precision. + </li> + <li> + <b>BUFFER_LENGTH</b> is not used. + </li> + <li> + <b>DECIMAL_DIGITS</b> long => the number of fractional digits + </li> + <li> + <b>NUM_PREC_RADIX</b> long => Radix (typically either 10 or 2) + </li> + <li> + <b>NULLABLE</b> long => is NULL allowed? + <ul> + <li> NO_NULLS - might not allow NULL values + </li> + <li> NULLABLE - definitely allows NULL values + </li> + <li> NULLABLE_UNKNOWN - nullability unknown + </li> + </ul> + </li> + <li> + <b>REMARKS</b> string => comment describing column (may be `NULL`) + </li> + <li> + <b>COLUMN_DEF</b> string => default value (may be `NULL`) + </li> + <li> + <b>SQL_DATA_TYPE</b> long => unused + </li> + <li> + <b>SQL_DATETIME_SUB</b> long => unused + </li> + <li> + <b>CHAR_OCTET_LENGTH</b> long => for char types the + maximum number of bytes in the column + </li> + <li> + <b>ORDINAL_POSITION</b> int => index of column in table + (starting at 1) + </li> + <li> + <b>IS_NULLABLE</b> string => "NO" means column definitely + does not allow NULL values; "YES" means the column might + allow NULL values. An empty string means nobody knows. + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schemaPattern + a schema name pattern; "" retrieves those without a schema + @param tableNamePattern + a table name pattern + @param columnNamePattern + a column name pattern + @returns + each row is a column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getColumns([in]any catalog, [in]string schemaPattern, + [in]string tableNamePattern, [in]string columnNamePattern) + raises (SQLException); + + /** gets a description of the access rights for a table's columns. + + + <p> + Only privileges matching the column name criteria are + returned. They are ordered by COLUMN_NAME and PRIVILEGE. + </p> + <p>Each privilege description has the following columns: + </p> + <ol> + <li> + <b>TABLE_CAT</b> string => table catalog (may be `NULL`) + </li> + <li> + <b>TABLE_SCHEM</b> string => table schema (may be `NULL`) + </li> + <li> + <b>TABLE_NAME</b> string => table name + </li> + <li> + <b>COLUMN_NAME</b> string => column name + </li> + <li> + <b>GRANTOR</b> => granter of access (may be `NULL`) + </li> + <li> + <b>GRANTEE</b> string => grantee of access + </li> + <li> + <b>PRIVILEGE</b> string => name of access (SELECT, + INSERT, UPDATE, REFERENCES, ...) + </li> + <li> + <b>IS_GRANTABLE</b> string => "YES" if grantee is permitted + to grant to others; "NO" if not; `NULL` if unknown + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schema + a schema name ; "" retrieves those without a schema + @param table + a table name + @param columnNamePattern + a column name pattern + @returns + each row is a column privilege description + @throws SQLException + if a database access error occurs. + */ + XResultSet getColumnPrivileges([in]any catalog, [in]string schema, + [in]string table, [in]string columnNamePattern) raises (SQLException); + + /** gets a description of the access rights for each table available + in a catalog. Note that a table privilege applies to one or + more columns in the table. It would be wrong to assume that + this privilege applies to all columns (this may be `TRUE` for + some systems but is not `TRUE` for all.) + + + <p>Only privileges matching the schema and table name + criteria are returned. They are ordered by TABLE_SCHEM, + TABLE_NAME, and PRIVILEGE. + </p> + <p>Each privilege description has the following columns: + </p> + <ol> + <li> + <b>TABLE_CAT</b> string => table catalog (may be `NULL`) + </li> + <li> + <b>TABLE_SCHEM</b> string => table schema (may be `NULL`) + </li> + <li> + <b>TABLE_NAME</b> string => table name + </li> + <li> + <b>GRANTOR</b> => granter of access (may be `NULL`) + </li> + <li> + <b>GRANTEE</b> string => grantee of access + </li> + <li> + <b>PRIVILEGE</b> string => name of access (SELECT, + INSERT, UPDATE, REFERENCES, ...) + </li> + <li> + <b>IS_GRANTABLE</b> string => "YES" if grantee is permitted + to grant to others; "NO" if not; `NULL` if unknown + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schemaPattern + a schema name pattern; "" retrieves those without a schema + @param tableNamePattern + a table name pattern + @returns + each row is a table privilege description + @throws SQLException + if a database access error occurs. + */ + XResultSet getTablePrivileges([in]any catalog, [in]string schemaPattern, + [in]string tableNamePattern) raises (SQLException); + + /** gets a description of a table's optimal set of columns that + uniquely identifies a row. They are ordered by SCOPE. + + + <p>Each column description has the following columns: + </p> + <ol> + <li> + <b>SCOPE</b> short => actual scope of result + <ul> + <li> TEMPORARY - very temporary, while using row + </li> + <li> TRANSACTION - valid for remainder of current transaction + </li> + <li> SESSION - valid for remainder of current session + </li> + </ul> + </li> + <li> + <b>COLUMN_NAME</b> string => column name + </li> + <li> + <b>DATA_TYPE</b> short => SQL data type from java.sql.Types + </li> + <li> + <b>TYPE_NAME</b> string => Data source dependent type name, + for a UDT the type name is fully qualified + </li> + <li> + <b>COLUMN_SIZE</b> long => precision + </li> + <li> + <b>BUFFER_LENGTH</b> long => not used + </li> + <li> + <b>DECIMAL_DIGITS</b> short => scale + </li> + <li> + <b>PSEUDO_COLUMN</b> short => is this a pseudo column + like an Oracle ROWID + <ul> + <li> UNKNOWN - may or may not be pseudo column + </li> + <li> NOT_PSEUDO - is NOT a pseudo column + </li> + <li> PSEUDO - is a pseudo column + </li> + </ul> + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schema + a schema name; "" retrieves those without a schema + @param table + a table name + @param scope + the scope of interest; use same values as SCOPE + @param nullable + include columns that are nullable? + @returns + each row is a column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getBestRowIdentifier([in]any catalog, [in]string schema, + [in]string table, [in]long scope, [in] boolean nullable) + raises (SQLException); + + /** gets a description of a table's columns that are automatically + updated when any value in a row is updated. They are + unordered. + + + <p>Each column description has the following columns: + </p> + <ol> + <li> + <b>SCOPE</b> short => is not used + </li> + <li> + <b>COLUMN_NAME</b> string => column name + </li> + <li> + <b>DATA_TYPE</b> short => SQL data type from java.sql.Types + </li> + <li> + <b>TYPE_NAME</b> string => Data source dependent type name + </li> + <li> + <b>COLUMN_SIZE</b> long => precision + </li> + <li> + <b>BUFFER_LENGTH</b> long => length of column value in bytes + </li> + <li> + <b>DECIMAL_DIGITS</b> short => scale + </li> + <li> + <b>PSEUDO_COLUMN</b> short => is this a pseudo column + like an Oracle ROWID + <ul> + <li> UNKNOWN - may or may not be pseudo column + </li> + <li> NOT_PSEUDO - is NOT a pseudo column + </li> + <li> PSEUDO - is a pseudo column + </li> + </ul> + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schema + a schema name; "" retrieves those without a schema + @param table + a table name + @returns + each row is a column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getVersionColumns([in]any catalog, [in]string schema, + [in]string table) raises (SQLException); + + /** gets a description of a table's primary key columns. They + are ordered by COLUMN_NAME. + + + <p>Each primary key column description has the following columns: + </p> + <ol> + <li> + <b>TABLE_CAT</b> string => table catalog (may be `NULL`) + </li> + <li> + <b>TABLE_SCHEM</b> string => table schema (may be `NULL`) + </li> + <li> + <b>TABLE_NAME</b> string => table name + </li> + <li> + <b>COLUMN_NAME</b> string => column name + </li> + <li> + <b>KEY_SEQ</b> short => sequence number within primary key + </li> + <li> + <b>PK_NAME</b> string => primary key name (may be `NULL`) + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schema + a schema name; "" retrieves those without a schema + @param table + a table name + @returns + each row is a primary key column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getPrimaryKeys([in]any catalog, [in]string schema, + [in]string table) raises (SQLException); + + /** gets a description of the primary key columns that are + referenced by a table's foreign key columns (the primary keys + imported by a table). They are ordered by PKTABLE_CAT, + PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ. + + + <p>Each primary key column description has the following columns: + </p> + <ol> + <li> + <b>PKTABLE_CAT</b> string => primary key table catalog + being imported (may be `NULL`) + </li> + <li> + <b>PKTABLE_SCHEM</b> string => primary key table schema + being imported (may be `NULL`) + </li> + <li> + <b>PKTABLE_NAME</b> string => primary key table name + being imported + </li> + <li> + <b>PKCOLUMN_NAME</b> string => primary key column name + being imported + </li> + <li> + <b>FKTABLE_CAT</b> string => foreign key table catalog (may be `NULL`) + </li> + <li> + <b>FKTABLE_SCHEM</b> string => foreign key table schema (may be `NULL`) + </li> + <li> + <b>FKTABLE_NAME</b> string => foreign key table name + </li> + <li> + <b>FKCOLUMN_NAME</b> string => foreign key column name + </li> + <li> + <b>KEY_SEQ</b> short => sequence number within foreign key + </li> + <li> + <b>UPDATE_RULE</b> short => What happens to + foreign key when primary is updated: + <ul> + <li> importedNoAction - do not allow update of primary + key if it has been imported + </li> + <li> importedKeyCascade - change imported key to agree + with primary key update + </li> + <li> importedKeySetNull - change imported key to NULL if + its primary key has been updated + </li> + <li> importedKeySetDefault - change imported key to default values + if its primary key has been updated + </li> + <li> importedKeyRestrict - same as importedKeyNoAction + (for ODBC 2.x compatibility) + </li> + </ul> + </li> + <li> + <b>DELETE_RULE</b> short => What happens to + the foreign key when primary is deleted. + <ul> + <li> importedKeyNoAction - do not allow delete of primary + key if it has been imported + </li> + <li> importedKeyCascade - delete rows that import a deleted key + </li> + <li> importedKeySetNull - change imported key to NULL if + its primary key has been deleted + </li> + <li> importedKeyRestrict - same as importedKeyNoAction + (for ODBC 2.x compatibility) + </li> + <li> importedKeySetDefault - change imported key to default if + its primary key has been deleted + </li> + </ul> + </li> + <li> + <b>FK_NAME</b> string => foreign key name (may be `NULL`) + </li> + <li> + <b>PK_NAME</b> string => primary key name (may be `NULL`) + </li> + <li> + <b>DEFERRABILITY</b> short => can the evaluation of foreign key + constraints be deferred until commit + <ul> + <li> importedKeyInitiallyDeferred - see SQL92 for definition + </li> + <li> importedKeyInitiallyImmediate - see SQL92 for definition + </li> + <li> importedKeyNotDeferrable - see SQL92 for definition + </li> + </ul> + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schema + a schema name; "" retrieves those without a schema + @param table + a table name + @returns + each row is a primary key column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getImportedKeys([in]any catalog, [in]string schema, + [in]string table) raises (SQLException); + + /** gets a description of the foreign key columns that reference a + table's primary key columns (the foreign keys exported by a + table). They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, + FKTABLE_NAME, and KEY_SEQ. + + + <p>Each foreign key column description has the following columns: + </p> + <ol> + <li> + <b>PKTABLE_CAT</b> string => primary key table catalog (may be `NULL`) + </li> + <li> + <b>PKTABLE_SCHEM</b> string => primary key table schema (may be `NULL`) + </li> + <li> + <b>PKTABLE_NAME</b> string => primary key table name + </li> + <li> + <b>PKCOLUMN_NAME</b> string => primary key column name + </li> + <li> + <b>FKTABLE_CAT</b> string => foreign key table catalog (may be `NULL`) + being exported (may be `NULL`) + </li> + <li> + <b>FKTABLE_SCHEM</b> string => foreign key table schema (may be `NULL`) + being exported (may be `NULL`) + </li> + <li> + <b>FKTABLE_NAME</b> string => foreign key table name + being exported + </li> + <li> + <b>FKCOLUMN_NAME</b> string => foreign key column name + being exported + </li> + <li> + <b>KEY_SEQ</b> short => sequence number within foreign key + </li> + <li> + <b>UPDATE_RULE</b> short => What happens to + foreign key when primary is updated: + <ul> + <li> NO_ACTION - do not allow update of primary + key if it has been imported + </li> + <li> CASCADE - change imported key to agree + with primary key update + </li> + <li> SET_NULL - change imported key to NULL if + its primary key has been updated + </li> + <li> SET_DEFAULT - change imported key to default values + if its primary key has been updated + </li> + <li> RESTRICT - same as importedKeyNoAction + (for ODBC 2.x compatibility) + </li> + </ul> + </li> + <li> + <b>DELETE_RULE</b> short => What happens to + the foreign key when primary is deleted. + <ul> + <li> NO_ACTION - do not allow delete of primary + key if it has been imported + </li> + <li> CASCADE - delete rows that import a deleted key + </li> + <li> SET_NULL - change imported key to NULL if + its primary key has been deleted + </li> + <li> RESTRICT - same as importedKeyNoAction + (for ODBC 2.x compatibility) + </li> + <li> SET_DEFAULT - change imported key to default if + its primary key has been deleted + </li> + </ul> + </li> + <li> + <b>FK_NAME</b> string => foreign key name (may be `NULL`) + </li> + <li> + <b>PK_NAME</b> string => primary key name (may be `NULL`) + </li> + <li> + <b>DEFERRABILITY</b> short => can the evaluation of foreign key + constraints be deferred until commit + <ul> + <li> INITIALLY_DEFERRED - see SQL92 for definition + </li> + <li> INITIALLY_IMMEDIATE - see SQL92 for definition + </li> + <li> NONE - see SQL92 for definition + </li> + </ul> + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schema + a schema name; "" retrieves those without a schema + @param table + a table name + @returns + each row is a foreign key column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getExportedKeys([in]any catalog, [in]string schema, + [in]string table) raises (SQLException); + + /** gets a description of the foreign key columns in the foreign key + table that reference the primary key columns of the primary key + table (describe how one table imports another's key.) This + should normally return a single foreign key/primary key pair + (most tables only import a foreign key from a table once.). They + are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and + KEY_SEQ. + + + <p>Each foreign key column description has the following columns: + </p> + <ol> + <li> + <b>PKTABLE_CAT</b> string => primary key table catalog (may be `NULL`) + </li> + <li> + <b>PKTABLE_SCHEM</b> string => primary key table schema (may be `NULL`) + </li> + <li> + <b>PKTABLE_NAME</b> string => primary key table name + </li> + <li> + <b>PKCOLUMN_NAME</b> string => primary key column name + </li> + <li> + <b>FKTABLE_CAT</b> string => foreign key table catalog (may be `NULL`) + being exported (may be `NULL`) + </li> + <li> + <b>FKTABLE_SCHEM</b> string => foreign key table schema (may be `NULL`) + being exported (may be `NULL`) + </li> + <li> + <b>FKTABLE_NAME</b> string => foreign key table name + being exported + </li> + <li> + <b>FKCOLUMN_NAME</b> string => foreign key column name + being exported + </li> + <li> + <b>KEY_SEQ</b> short => sequence number within foreign key + </li> + <li> + <b>UPDATE_RULE</b> short => What happens to + foreign key when primary is updated: + <ul> + <li> NO_ACTION - do not allow update of primary + key if it has been imported + </li> + <li> CASCADE - change imported key to agree + with primary key update + </li> + <li> SET_NULL - change imported key to NULL if + its primary key has been updated + </li> + <li> SET_DEFAULT - change imported key to default values + if its primary key has been updated + </li> + <li> RESTRICT - same as importedKeyNoAction + (for ODBC 2.x compatibility) + </li> + </ul> + </li> + <li> + <b>DELETE_RULE</b> short => What happens to + the foreign key when primary is deleted. + <ul> + <li> NO_ACTION - do not allow delete of primary + key if it has been imported + </li> + <li> CASCADE - delete rows that import a deleted key + </li> + <li> SET_NULL - change imported key to NULL if + its primary key has been deleted + </li> + <li> RESTRICT - same as importedKeyNoAction + (for ODBC 2.x compatibility) + </li> + <li> SET_DEFAULT - change imported key to default if + its primary key has been deleted + </li> + </ul> + </li> + <li> + <b>FK_NAME</b> string => foreign key name (may be `NULL`) + </li> + <li> + <b>PK_NAME</b> string => primary key name (may be `NULL`) + </li> + <li> + <b>DEFERRABILITY</b> short => can the evaluation of foreign key + constraints be deferred until commit + <ul> + <li> INITIALLY_DEFERRED - see SQL92 for definition + </li> + <li> INITIALLY_IMMEDIATE - see SQL92 for definition + </li> + <li> NONE - see SQL92 for definition + </li> + </ul> + </li> + </ol> + @param primaryCatalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param primarySchema + a schema name; "" retrieves those without a schema + @param primaryTable + the table name that exports the key + @param foreignCatalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param foreignSchema + a schema name; "" retrieves those without a schema + @param foreignTable + the table name that imports the key + @returns + each row is a foreign key column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getCrossReference( + [in]any primaryCatalog, [in]string primarySchema, + [in]string primaryTable, + [in]any foreignCatalog, [in]string foreignSchema, + [in]string foreignTable) raises (SQLException); + + /** gets a description of all the standard SQL types supported by + this database. They are ordered by DATA_TYPE and then by how + closely the data type maps to the corresponding SDBC SQL type. + + + + <p>Each type description has the following columns: + </p> + <ol> + <li> + <b>TYPE_NAME</b> string => Type name + </li> + <li> + <b>DATA_TYPE</b> short => SQL data type from java.sql.Types + </li> + <li> + <b>PRECISION</b> long => maximum precision + </li> + <li> + <b>LITERAL_PREFIX</b> string => prefix used to quote a literal + (may be `NULL`) + </li> + <li> + <b>LITERAL_SUFFIX</b> string => suffix used to quote a literal + (may be `NULL`) + </li> + <li> + <b>CREATE_PARAMS</b> string => parameters used in creating + the type (may be `NULL`) + </li> + <li> + <b>NULLABLE</b> short => can you use NULL for this type? + <ul> + <li> NO_NULLS - does not allow NULL values + </li> + <li> NULLABLE - allows NULL values + </li> + <li> NULLABLE_UNKNOWN - nullability unknown + </li> + </ul> + </li> + <li> + <b>CASE_SENSITIVE</b> boolean=> is it case sensitive? + </li> + <li> + <b>SEARCHABLE</b> short => can you use "WHERE" based on this type: + <ul> + <li> NONE - No support + </li> + <li> CHAR - Only supported with WHERE .. LIKE + </li> + <li> BASIC - Supported except for WHERE .. LIKE + </li> + <li> FULL - Supported for all WHERE .. + </li> + </ul> + </li> + <li> + <b>UNSIGNED_ATTRIBUTE</b> boolean => is it unsigned? + </li> + <li> + <b>FIXED_PREC_SCALE</b> boolean => can it be a money value? + </li> + <li> + <b>AUTO_INCREMENT</b> boolean => can it be used for an + auto-increment value? + </li> + <li> + <b>LOCAL_TYPE_NAME</b> string => localized version of type name + (may be `NULL`) + </li> + <li> + <b>MINIMUM_SCALE</b> short => minimum scale supported + </li> + <li> + <b>MAXIMUM_SCALE</b> short => maximum scale supported + </li> + <li> + <b>SQL_DATA_TYPE</b> long => unused + </li> + <li> + <b>SQL_DATETIME_SUB</b> long => unused + </li> + <li> + <b>NUM_PREC_RADIX</b> long => usually 2 or 10 + </li> + </ol> + @returns + each row is a SQL type description + @throws SQLException + if a database access error occurs. + */ + XResultSet getTypeInfo() raises (SQLException); + + /** gets a description of a table's indices and statistics. They are + ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION. + + + <p>Each index column description has the following columns: + </p> + <ol> + <li> + <b>TABLE_CAT</b> string => table catalog (may be `NULL`) + </li> + <li> + <b>TABLE_SCHEM</b> string => table schema (may be `NULL`) + </li> + <li> + <b>TABLE_NAME</b> string => table name + </li> + <li> + <b>NON_UNIQUE</b> boolean => Can index values be non-unique? + `FALSE` when TYPE is tableIndexStatistic + </li> + <li> + <b>INDEX_QUALIFIER</b> string => index catalog (may be `NULL`); + `NULL` when TYPE is tableIndexStatistic + </li> + <li> + <b>INDEX_NAME</b> string => index name; `NULL` when TYPE is + tableIndexStatistic + </li> + <li> + <b>TYPE</b> short => index type: + <ul> + <li> 0 - this identifies table statistics that are + returned in conjunction with a table's index descriptions + </li> + <li> CLUSTERED - this is a clustered index + </li> + <li> HASHED - this is a hashed index + </li> + <li> OTHER - this is some other style of index + </li> + </ul> + </li> + <li> + <b>ORDINAL_POSITION</b> short => column sequence number + within index; zero when TYPE is tableIndexStatistic + </li> + <li> + <b>COLUMN_NAME</b> string => column name; `NULL` when TYPE is + tableIndexStatistic + </li> + <li> + <b>ASC_OR_DESC</b> string => column sort sequence, "A" => ascending, + "D" => descending, may be `NULL` if sort sequence is not supported; + `NULL` when TYPE is tableIndexStatistic + </li> + <li> + <b>CARDINALITY</b> long => When TYPE is tableIndexStatistic, then + this is the number of rows in the table; otherwise, it is the + number of unique values in the index. + </li> + <li> + <b>PAGES</b> long => When TYPE is tableIndexStatistic then + this is the number of pages used for the table, otherwise it + is the number of pages used for the current index. + </li> + <li> + <b>FILTER_CONDITION</b> string => Filter condition, if any. + (may be `NULL`) + </li> + </ol> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schema + a schema name; "" retrieves those without a schema + @param table + the table name that exports the key + @param unique + when `TRUE`, return only indices for unique values; when `FALSE`, return indices regardless of whether unique or not + @param approximate + when `TRUE`, result is allowed to reflect approximate or out of data values; when `FALSE`, results are requested to be accurate + @returns + each row is an index column description + @throws SQLException + if a database access error occurs. + */ + XResultSet getIndexInfo([in]any catalog, [in]string schema, [in]string table, + [in]boolean unique, [in]boolean approximate) + raises (SQLException); + + /** Does the database support the given result set type? + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsResultSetType([in]long setType) raises (SQLException); + + /** Does the database support the concurrency type in combination + with the given result set type? + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @param concurrency + defined in + com::sun::star::sdbc::ResultSetConcurrency + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsResultSetConcurrency([in]long setType, + [in]long concurrency) + raises (SQLException); + + /** indicates whether a result set's own updates are visible. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean ownUpdatesAreVisible([in]long setType) raises (SQLException); + + /** indicates whether a result set's own deletes are visible. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean ownDeletesAreVisible([in]long setType) raises (SQLException); + + /** indicates whether a result set's own inserts are visible. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean ownInsertsAreVisible([in]long setType) raises (SQLException); + + /** indicates whether updates made by others are visible. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean othersUpdatesAreVisible([in]long setType) raises (SQLException); + + /** indicates whether deletes made by others are visible. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean othersDeletesAreVisible([in]long setType) raises (SQLException); + + /** indicates whether inserts made by others are visible. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean othersInsertsAreVisible([in]long setType) raises (SQLException); + + /** indicates whether or not a visible row update can be detected by + calling the method + <code>XResultSet.rowUpdated</code>. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean updatesAreDetected([in]long setType) raises (SQLException); + + /** indicates whether or not a visible row delete can be detected by + calling com::sun::star::sdbc::XResultSet::rowDeleted(). + If deletesAreDetected() + returns `FALSE`, then deleted rows are removed from the result set. + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean deletesAreDetected([in]long setType) raises (SQLException); + + /** indicates whether or not a visible row insert can be detected + by calling + com::sun::star::sdbc::XResultSet::rowInserted().() + @param setType + defined in + com::sun::star::sdbc::ResultSetType + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean insertsAreDetected([in]long setType) raises (SQLException); + + /** indicates whether the driver supports batch updates. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean supportsBatchUpdates() raises (SQLException); + + /** Gets a description of the user-defined types defined in a particular + schema. Schema-specific UDTs may have type OBJECT, STRUCT, + or DISTINCT. + + + <p>Only types matching the catalog, schema, type name, and type + criteria are returned. They are ordered by DATA_TYPE, TYPE_SCHEM, + and TYPE_NAME. The type name parameter may be a fully-qualified + name. In this case, the catalog and schemaPattern parameters are + ignored. + </p> + <p>Each type description has the following columns: + </p> + <ol> + <li> + <b>TYPE_CAT</b> string => the type's catalog (may be `NULL`) + </li> + <li> + <b>TYPE_SCHEM</b> string => type's schema (may be `NULL`) + </li> + <li> + <b>TYPE_NAME</b> string => type name + </li> + <li> + <b>CLASS_NAME</b> string => Java class name or service name + </li> + <li> + <b>DATA_TYPE</b> string => type value. + One of OBJECT, STRUCT, or DISTINCT + </li> + <li> + <b>REMARKS</b> string => explanatory comment on the type + </li> + </ol> + <p> + <b>Note:</b> If the driver does not support UDTs, an empty + result set is returned. + </p> + @param catalog + a catalog name; "" retrieves those without a catalog; `VOID` means drop catalog name from the selection criteria + @param schemaPattern + a schema name pattern; "" retrieves those without a schema + @param typeNamePattern + a type name pattern; may be a fully-qualified name + @param types + a list of user-named types to include (OBJECT, STRUCT, or DISTINCT) + @returns + each row is a type description + @throws SQLException + if a database access error occurs. + */ + XResultSet getUDTs([in]any catalog, [in]string schemaPattern, + [in]string typeNamePattern, [in]sequence<long> types) + raises (SQLException); + + /** retrieves the connection that produced this metadata object. + @returns + the Connection object + @throws SQLException + if a database access error occurs. + */ + XConnection getConnection() raises (SQLException); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XDatabaseMetaData2.idl b/offapi/com/sun/star/sdbc/XDatabaseMetaData2.idl new file mode 100644 index 000000000..591b307d5 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XDatabaseMetaData2.idl @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_sdbc_XDatabaseMetaData2_idl__ +#define __com_sun_star_sdbc_XDatabaseMetaData2_idl__ + +#include <com/sun/star/sdbc/XDatabaseMetaData.idl> +#include <com/sun/star/beans/PropertyValue.idl> + + +module com { module sun { module star { module sdbc { + + +/** extends the XDatabaseMetaData interface to allow retrieval of additional + information. + */ +interface XDatabaseMetaData2 : XDatabaseMetaData +{ + /** complements XDatabaseMetaData::getURL by returning the settings which, + upon construction of the connection, have been used besides the connection + URL. + + @see XDriver::connect + */ + sequence< ::com::sun::star::beans::PropertyValue > + getConnectionInfo(); +}; + + +}; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XDriver.idl b/offapi/com/sun/star/sdbc/XDriver.idl new file mode 100644 index 000000000..ee45d105b --- /dev/null +++ b/offapi/com/sun/star/sdbc/XDriver.idl @@ -0,0 +1,163 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XDriver_idl__ +#define __com_sun_star_sdbc_XDriver_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/beans/PropertyValue.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + +#include <com/sun/star/sdbc/DriverPropertyInfo.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; + published interface XDriverManager; + + +/** is the interface that every driver class must implement. + + + + <p> + Each driver should supply a service that implements + the Driver interface. + + </p> + <p>The DriverManager will try to load as many drivers as it can + find, and then for any given connection request, it will ask each + driver in turn to try to connect to the target URL. + + </p> + <p> + It is strongly recommended that each Driver object should be + small and standalone so that the Driver object can be loaded and + queried without bringing in vast quantities of supporting code. + + </p> + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::XConnection + */ +published interface XDriver: com::sun::star::uno::XInterface +{ + + /** attempts to make a database connection to the given URL. + The driver should return + `NULL` + if it realizes it is the wrong kind + of driver to connect to the given URL. This will be common, as when + the driver manager is asked to connect to a given URL it passes + the URL to each loaded driver in turn. + + + + <p> + The driver should raise a + com::sun::star::sdbc::SQLException + if it is the right + driver to connect to the given URL, but has trouble connecting to + the database. + + </p> + <p> + The info argument can be used to pass arbitrary + string tag/value pairs as connection arguments. + Normally at least "user" and "password" properties should be + included in the Properties. For a JDBC driver also the Java class must + be supplied in the property named JavaDriverClass, and a class path (a + space-separated list of URLs) needed to locate that class can optionally + be supplied in a property named JavaDriverClassPath. + Possible property value names are when supported by the driver: + @see com::sun::star::sdbc::ConnectionProperties + </p> + + @param url + is the URL of the database to which to connect. + @param info + a list of arbitrary string tag/value pairs as connection arguments. Normally at least a "user" and "password" property should be included. + @see com::sun::star::sdbc::ConnectionProperties + @returns + a Connection object that represents a connection to the URL + @throws SQLException + if a database access error occurs + + */ + XConnection connect( + [in]string url, + [in]sequence<com::sun::star::beans::PropertyValue> info) + raises (SQLException); + + /** returns `TRUE` if the driver thinks that it can open a connection + to the given URL. Typically drivers will return `TRUE` if they + understand the subprotocol specified in the URL and `FALSE` if + they do not. + + @param url + is the URL of the database to which to connect. + @returns + `TRUE` if this driver can connect to the given URL. + @throws SQLException + if a database access error occurs. + */ + boolean acceptsURL([in]string url) raises (SQLException); + + /** gets information about the possible properties for this driver. + <p>The getPropertyInfo method is intended to allow a generic GUI tool to + discover what properties it should prompt a human for in order to get + enough information to connect to a database. Note that depending on + the values the human has supplied so far, additional values may become + necessary, so it may be necessary to iterate though several calls + to getPropertyInfo. + @param url + is the URL of the database to which to connect. + @param info + is a proposed list of tag/value pairs that will be sent on + connect open. + @returns + an array of DriverPropertyInfo objects describing possible + properties. This array may be an empty array if no properties + are required. + @throws SQLException + if a database access error occurs. + */ + sequence<DriverPropertyInfo> getPropertyInfo([in]string url, + [in] sequence<com::sun::star::beans::PropertyValue> info) + raises (SQLException); + + /** gets the driver's major version number. Initially this should be 1. + @returns + this driver's major version number + */ + long getMajorVersion(); + + /** gets the driver's minor version number. Initially this should be 0. + @returns + this driver's minor version number. + */ + long getMinorVersion(); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XDriverAccess.idl b/offapi/com/sun/star/sdbc/XDriverAccess.idl new file mode 100644 index 000000000..c0f907f3b --- /dev/null +++ b/offapi/com/sun/star/sdbc/XDriverAccess.idl @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XDriverAccess_idl__ +#define __com_sun_star_sdbc_XDriverAccess_idl__ + +#include <com/sun/star/uno/XInterface.idl> + + module com { module sun { module star { module sdbc { + + published interface XDriver; + + + +/** provides the access of sdbc driver components + @see com::sun::star::sdbc::XDriverManager + @see com::sun::star::sdbc::XDriver + */ +published interface XDriverAccess: com::sun::star::uno::XInterface +{ + + /** get a driver which accepts a given url.@see com::sun::star::sdbc::XDriver::acceptsURL + @param url + a database url of the form sdbc:subprotocol:subname + @returns + a Driver that can connect to the URL + @throws SQLException + if a database access error occurs. + */ + XDriver getDriverByURL([in]string url); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XDriverManager.idl b/offapi/com/sun/star/sdbc/XDriverManager.idl new file mode 100644 index 000000000..00f8de420 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XDriverManager.idl @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XDriverManager_idl__ +#define __com_sun_star_sdbc_XDriverManager_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/beans/PropertyValue.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; + published interface XDriver; + + +/** is the basic interface for managing a set of SDBC drivers. + + + + <p> + When the method + com::sun::star::sdbc::XDriverManager::getConnection() + is called, + the DriverManager will attempt to + locate a suitable driver. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XConnection + */ +published interface XDriverManager: com::sun::star::uno::XInterface +{ + + /** attempts to establish a connection to the given database URL. + The DriverManager attempts to select an appropriate driver from + the set of registered JDBC/SDBC drivers. + @param url + a database url of the form sdbc:subprotocol:subname + @returns + the Connection object + @throws SQLException + if a database access error occurs. + */ + XConnection getConnection([in]string url) + raises (SQLException); + + /** attempts to establish a connection to the given database URL. + The DriverManager attempts to select an appropriate driver from + the set of registered JDBC/SDBC drivers. + @param url + a database url of the form sdbc:subprotocol:subname + @param info + a list of arbitrary string tag/value pairs as connection arguments; + normally at least a "user" and "password" property should be included + @see com::sun::star::sdbc::ConnectionProperties + @returns + the Connection object + @throws SQLException + if a database access error occurs. + */ + XConnection getConnectionWithInfo([in]string url, + [in]sequence<com::sun::star::beans::PropertyValue> info) + raises (SQLException); + + /** sets the maximum time in seconds that a driver will wait + while attempting to connect to a database. + @param seconds + the login time limit in seconds + + @throws SQLException + if a database access error occurs. + */ + void setLoginTimeout([in]long seconds); + + /** gets the maximum time in seconds that a driver can wait + when attempting to login to a database. + @returns + the driver login time limit in seconds + + @throws SQLException + if a database access error occurs. + */ + long getLoginTimeout(); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XDriverManager2.idl b/offapi/com/sun/star/sdbc/XDriverManager2.idl new file mode 100644 index 000000000..8477e1b5d --- /dev/null +++ b/offapi/com/sun/star/sdbc/XDriverManager2.idl @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XDriverManager2_idl__ +#define __com_sun_star_sdbc_XDriverManager2_idl__ + +#include <com/sun/star/container/XEnumerationAccess.idl> +#include <com/sun/star/sdbc/XDriverManager.idl> +#include <com/sun/star/sdbc/XDriverAccess.idl> + +module com { module sun { module star { module sdbc { + +/** is the basic interface for managing a set of SDBC drivers. + + <p> + As part of its initialization, the DriverManager service will + attempt to load the registered drivers. + + </p> + <p> + When the method <code>getConnection</code> is called, + the DriverManager will attempt to + locate a suitable driver. + + </p> + @see com::sun::star::sdbc::XDriver + @see com::sun::star::sdbc::XConnection + @since LibreOffice 4.0 + */ +published interface XDriverManager2 +{ + + /** is the basic interface for establishing database connections. + */ + interface XDriverManager; + + interface XDriverAccess; + + /** creates an enumeration on all installed / registered drivers. + */ + interface com::sun::star::container::XEnumerationAccess; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XGeneratedResultSet.idl b/offapi/com/sun/star/sdbc/XGeneratedResultSet.idl new file mode 100644 index 000000000..5418267ab --- /dev/null +++ b/offapi/com/sun/star/sdbc/XGeneratedResultSet.idl @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XGeneratedResultSet_idl__ +#define __com_sun_star_sdbc_XGeneratedResultSet_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XResultSet; + +/** provides a result set which gives access to automatically generated values after a new row was inserted. + + <p>The relative order of columns in the result set returned by getGeneratedValues() must be the same + as the relative order of the same columns as returned when executing a "SELECT * FROM table". This ensures that + clients of this interface can reliably fetch the column values.</p> + + @see com::sun::star::sdbc::Statement + @see com::sun::star::sdbc::PreparedStatement + @since OOo 1.1.2 + */ +published interface XGeneratedResultSet: com::sun::star::uno::XInterface +{ + /** gives access to automatically generated values after a new row was inserted. + @returns + a result set that contains the data produced by the query + @throws SQLException + if a database access error occurs. + */ + XResultSet getGeneratedValues() raises (SQLException); + +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XIsolatedConnection.idl b/offapi/com/sun/star/sdbc/XIsolatedConnection.idl new file mode 100644 index 000000000..5f24abe8b --- /dev/null +++ b/offapi/com/sun/star/sdbc/XIsolatedConnection.idl @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XIsolatedConnection_idl__ +#define __com_sun_star_sdbc_XIsolatedConnection_idl__ + +#include <com/sun/star/task/XInteractionHandler.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; +/** is used for establishing isolated connections via a factory. + <p> + The XIsolatedConnection allows to create connections which are not shared among others + as it is the case when creating connections in normal way. + </p> + @see com::sun::star::sdb::DataSource + @since OOo 1.1.2 + */ +published interface XIsolatedConnection: com::sun::star::uno::XInterface +{ + /** attempts to establish a database connection. + <p>If information is missing, such as + a user's password, they are completed by user interaction.</p> + @param handler + The handler which ask for the needed information when they are missing. + @returns + A connection which is not shared. + @throws com::sun::star::sdbc::SQLException + when an error occurs. + */ + XConnection + getIsolatedConnectionWithCompletion([in]com::sun::star::task::XInteractionHandler handler) + raises (SQLException); + + /** attempts to establish a database connection. + @param user + The user name. + @param password + The password. + @returns + A connection which is not shared. + @throws com::sun::star::sdbc::SQLException + when an error occurs. + */ + XConnection getIsolatedConnection([in]string user, [in]string password) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XMultipleResults.idl b/offapi/com/sun/star/sdbc/XMultipleResults.idl new file mode 100644 index 000000000..d496243f1 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XMultipleResults.idl @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XMultipleResults_idl__ +#define __com_sun_star_sdbc_XMultipleResults_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XResultSet; + + +/** is used for inspecting multiple results produced by the execution of a + SQL statement. + + + <p> + Under some (uncommon) situations a single SQL statement may return + multiple result sets and/or update counts. Normally you can ignore + this unless you are (1) executing a stored procedure that you know may + return multiple results or (2) you are dynamically executing an + unknown SQL string. The methods + com::sun::star::sdbc::XMultipleResults::getMoreResults() + , + com::sun::star::sdbc::XMultipleResults::getResultSet() + and + com::sun::star::sdbc::XMultipleResults::getUpdateCount() + let you navigate through multiple results. + + </p> + @see com::sun::star::sdbc::XStatement + @see com::sun::star::sdbc::XPreparedStatement + */ +published interface XMultipleResults: com::sun::star::uno::XInterface +{ + + /** returns the current result as a + com::sun::star::sdbc::ResultSet + object. + This method should be called only once per result. + @returns + the ResultSet object + @throws SQLException + if a database access error occurs. + */ + XResultSet getResultSet() raises (SQLException); + + /** returns the current result as an update count. + + + <p> + If the result is a ResultSet or there are no more results, -1 + is returned. This method should be called only once per result. + </p> + @returns + the current result as an update count. + @throws SQLException + if a database access error occurs. + */ + long getUpdateCount() raises (SQLException); + + /** moves to a Statement's next result. It returns `TRUE` if + this result is a ResultSet. This method also implicitly + closes any current ResultSet obtained with getResultSet. + + <p> + There are no more results when <code>(!getMoreResults() &amp;&amp; + getUpdateCount() == -1)</code>. + + </p> + @returns + `TRUE` if there exists more ResultSet objects + @throws SQLException + if a database access error occurs. + */ + boolean getMoreResults() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XOutParameters.idl b/offapi/com/sun/star/sdbc/XOutParameters.idl new file mode 100644 index 000000000..d378ae5e2 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XOutParameters.idl @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XOutParameters_idl__ +#define __com_sun_star_sdbc_XOutParameters_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is used to register Out-Parameters for stored procedures. + + + <p> + SDBC provides a stored procedure SQL escape that allows stored procedures + to be called in a standard way for all RDBMSs. This escape syntax has one + form that includes a result parameter and one that does not. If used, the + result parameter must be registered as an OUT parameter. The other parameters + can be used for input, output, or both. Parameters are referred to sequentially, + by number. The first parameter is 1. + </p> + */ +published interface XOutParameters: com::sun::star::uno::XInterface +{ + + /** registers the designated output parameter. This version of + the method + com::sun::star::sdbc::XOutParameters::registerOutParameter() + should be used for a user-named or REF output parameter. Examples + of user-named types include: STRUCT, DISTINCT, OBJECT, and named array + types. + + <p> + Before executing a stored procedure call, you must explicitly + call + com::sun::star::sdbc::XOutParameters::registerOutParameter() + to register the type from + com::sun::star::sdbc::DataType + for each OUT parameter. + <br/> + For a user-named parameter the fully-qualified SQL type name of the + parameter should also be given, while a REF parameter requires that the + fully-qualified type name of the referenced type be given. + An SDBC driver that does not need the type code and type name information + may ignore it. To be portable, however, applications should always provide + these values for user-named and REF parameters. + </p> + <p>Although it is intended for user-named and REF parameters, + this method may be used to register a parameter of any SDBC type. + If the parameter does not have a user-named or REF type, the + typeName parameter is ignored. + </p> + <p> + <b>Note:</b> When reading the value of an out parameter, you + must use the + <code>getXXX</code> + method whose type XXX corresponds to the + parameter's registered SQL type. + </p> + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param sqlType + the type of the column to register + @param typeName + the name of the type + @throws SQLException + if a database access error occurs. + */ + void registerOutParameter([in]long parameterIndex, [in]long sqlType, + [in]string typeName) + raises (SQLException); + + /** registers the OUT parameter in ordinal position + <code>parameterIndex</code> + to the SDBC type <code>sqlType</code>. All + OUT parameters must be registered before a stored procedure is executed. + + + <p> + The SDBC type specified by + <code>sqlType</code> + for an OUT parameter determines the type that must be used in the + <code>get</code> + method to read the value of that parameter. + This version of + com::sun::star::sdbc::XOutParameters::registerOutParameter() + should be + used when the parameter is of SDBC type + com::sun::star::sdbc::DataType::NUMERIC + or com::sun::star::sdbc::DataType::DECIMAL. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param sqlType + the type of the column to register + @param scale + the scale of the type + @throws SQLException + if a database access error occurs. + </p> + */ + void registerNumericOutParameter([in]long parameterIndex, [in]long sqlType, + [in]long scale) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XParameters.idl b/offapi/com/sun/star/sdbc/XParameters.idl new file mode 100644 index 000000000..6f1beca0a --- /dev/null +++ b/offapi/com/sun/star/sdbc/XParameters.idl @@ -0,0 +1,422 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XParameters_idl__ +#define __com_sun_star_sdbc_XParameters_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/util/Date.idl> + +#include <com/sun/star/util/DateTime.idl> + +#include <com/sun/star/util/Time.idl> + + module com { module sun { module star { module io { + published interface XInputStream; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XRef; + published interface XArray; + published interface XBlob; + published interface XClob; + + +/** is used for parameter setting, commonly implemented in conjunction with + PreparedStatements. + + + <p> + <b>Note:</b> The setXXX methods for setting IN parameter values + must specify types that are compatible with the defined SQL type of + the input parameter. For instance, if the IN parameter has SQL type + Integer, then the method + com::sun::star::sdbc::XParameters::setInt() + should be used. + + </p> + <p> + If arbitrary parameter type conversions are required, the method + com::sun::star::sdbc::XParameters::setObject() + should be used with a target SQL type. + <br/> + <br/> + Example of setting a parameter; + <code>con</code> + is an active connection. + </p> + + @code{.bas} + pstmt = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?") + pstmt.setDouble(1, 153833.00) + pstmt.setLong(2, 110592) + @endcode + + @see com::sun::star::sdbc::XPreparedStatement + */ +published interface XParameters: com::sun::star::uno::XInterface +{ + + /** sets the designated parameter to SQL NULL. + */ + void setNull([in]long parameterIndex, + [in]long sqlType) raises (SQLException); + + /** sets the designated parameter to SQL NULL. This version of setNull should + be used for user-named types and REF type parameters. Examples + of user-named types include: STRUCT, DISTINCT, OBJECT, and + named array types. + + + <p> + <b>Note:</b> To be portable, applications must give the + SQL type code and the fully-qualified SQL type name when specifying + a NULL user-defined or REF parameter. In the case of a user-named type + the name is the type name of the parameter itself. For a REF + parameter the name is the type name of the referenced type. If + a SDBC driver does not need the type code or type name information, + it may ignore it. + <br/> + Although it is intended for user-named and Ref parameters, + this method may be used to set a null parameter of any JDBC type. + If the parameter does not have a user-named or REF type, the given + typeName is ignored. + </p> + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param sqlType + the type of the column to set to `NULL` + @param typeName + the name of the type + @throws SQLException + if a database access error occurs. + */ + void setObjectNull([in]long parameterIndex, + [in]long sqlType, + [in]string typeName) raises (SQLException); + + /** sets the designated parameter to a boolean value. The driver converts this + to a SQL BIT value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setBoolean([in]long parameterIndex, [in]boolean x) + raises (SQLException); + + /** sets the designated parameter to a byte value. The driver converts this + to a SQL TINYINT value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setByte([in]long parameterIndex, [in]byte x) raises (SQLException); + + /** sets the designated parameter to a short value. The driver converts this + to a SQL SMALLINT value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setShort([in]long parameterIndex, [in]short x) raises (SQLException); + + /** sets the designated parameter to a long value. The driver converts this + to a SQL INTEGER value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setInt([in]long parameterIndex, [in]long x) raises (SQLException); + + /** sets the designated parameter to a hyper value. The driver converts this + to a SQL BIGINT value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setLong([in]long parameterIndex, [in]hyper x) raises (SQLException); + + /** sets the designated parameter to a float value. The driver converts this + to a SQL FLOAT value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setFloat([in]long parameterIndex, [in]float x) raises (SQLException); + + /** sets the designated parameter to a double value. The driver converts this + to a SQL DOUBLE value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setDouble([in]long parameterIndex, [in]double x) raises (SQLException); + + /** sets the designated parameter to a string value. The driver converts this + to a SQL VARCHAR or LONGVARCHAR value (depending on the argument's + size relative to the driver's limits on VARCHARs) when it sends + it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setString([in]long parameterIndex, [in]string x) raises (SQLException); + + /** sets the designated parameter to a sequence of bytes. The driver converts + this to a SQL VARBINARY or LONGVARBINARY (depending on the + argument's size relative to the driver's limits on VARBINARYs) + when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setBytes([in]long parameterIndex, [in]sequence<byte> x) + raises (SQLException); + + /** sets the designated parameter to a date value. The driver converts this + to a SQL DATE value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setDate([in]long parameterIndex, [in]com::sun::star::util::Date x) + raises (SQLException); + + /** sets the designated parameter to a time value. The driver converts this + to a SQL TIME value when it sends it to the database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setTime([in]long parameterIndex, [in]com::sun::star::util::Time x) + raises (SQLException); + + /** sets the designated parameter to a datetime value. The driver + converts this to a SQL TIMESTAMP value when it sends it to the + database. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setTimestamp([in]long parameterIndex, + [in]com::sun::star::util::DateTime x) raises (SQLException); + + /** sets the designated parameter to the given input stream, which will have + the specified number of bytes. + When a very large binary value is input to a LONGVARBINARY or LONGVARCHAR + parameter, it may be more practical to send it via an + com::sun::star::io::XInputStream + . SDBC will read the data from the stream as needed, until it reaches end-of-file. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @param length + the number of bytes in the stream + @throws SQLException + if a database access error occurs. + */ + void setBinaryStream([in]long parameterIndex, + [in]com::sun::star::io::XInputStream x, + [in]long length) raises (SQLException); + + /** sets the designated parameter to the given input stream, which will have + the specified number of bytes. + When a very large binary value is input to a LONGVARCHAR + parameter, it may be more practical to send it via a + com::sun::star::io::XInputStream + . SDBC will read the data from the stream as needed, until it reaches end-of-file. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @param length + the number of characters in the stream + @throws SQLException + if a database access error occurs. + */ + void setCharacterStream([in]long parameterIndex, + [in]com::sun::star::io::XInputStream x, + [in]long length) raises (SQLException); + + /** sets the value of a parameter using an any. + + + <p>The given object will be converted to the targetSqlType + before being sent to the database. + If the object has a custom mapping (is of a class implementing SQLData), + the SDBC driver should call its method <code>writeSQL</code> to write it + to the SQL data stream. + If, on the other hand, the object is of a service implementing Ref, Blob, + Clob, Struct, or Array, the driver should pass it to the database as a + value of the corresponding SQL type. + </p> + <p>Note that this method may be used to pass database-specific + abstract data types. + </p> + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setObject([in]long parameterIndex, [in]any x) + raises (SQLException); + + /** set a value from the Datatype ANY for a parameter. + + + + <p>The given object will be converted to the targetSqlType + before being sent to the database. + If the object has a custom mapping (is of a class implementing SQLData), + the SDBC driver should call its method <code>writeSQL</code> to write it + to the SQL data stream. + If, on the other hand, the object is of a service implementing Ref, Blob, + Clob, Struct, or Array, the driver should pass it to the database as a + value of the corresponding SQL type. + </p> + <p>Note that this method may be used to pass database-specific + abstract data types. + </p> + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @param targetSqlType + the SQL type (as defined in + com::sun::star::sdbc::DataType + ) to be sent to the database. The scale argument may further qualify this type. + @param scale + for + com::sun::star::sdbc::DataType::DECIMAL + or + com::sun::star::sdbc::DataType::NUMERIC + types, this is the number of digits after the decimal point. For all other types, this value will be ignored. + @throws SQLException + if a database access error occurs. + */ + void setObjectWithInfo([in]long parameterIndex, + [in]any x, [in]long targetSqlType, [in]long scale) + raises (SQLException); + + /** sets a REF(&lt;structured-type&gt;) parameter. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setRef ([in]long parameterIndex, [in]XRef x) raises (SQLException); + + /** sets a BLOB parameter. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setBlob ([in]long parameterIndex, [in]XBlob x) raises (SQLException); + + /** sets a CLOB parameter. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setClob ([in]long parameterIndex, [in]XClob x) raises (SQLException); + + /** sets an Array parameter. + @param parameterIndex + the first parameter is 1, the second is 2, ... + @param x + the parameter value + @throws SQLException + if a database access error occurs. + */ + void setArray ([in]long parameterIndex, [in]XArray x) raises (SQLException); + + + /** clears the current parameter values immediately. + + + <p>In general, parameter values remain in force for repeated use of a + Statement. Setting a parameter value automatically clears its + previous value. However, in some cases it is useful to immediately + release the resources used by the current parameter values; this can + be done by calling clearParameters. + </p> + @throws SQLException + if a database access error occurs. + */ + void clearParameters() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XPooledConnection.idl b/offapi/com/sun/star/sdbc/XPooledConnection.idl new file mode 100644 index 000000000..3949c0bc3 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XPooledConnection.idl @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_sdbc_XPooledConnection_idl__ +#define __com_sun_star_sdbc_XPooledConnection_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/beans/PropertyValue.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; + +/** defines a pooled connection which can share an unused connection. + +<!-- JRH: unclear meaning --> + + <p> + PoolConnections are handled by the connection pool. + </p> + <p> + When the method + com::sun::star::sdbc::XPooledConnection::getConnection() + is called, the PooledConnection returns the connection which is pooled. + </p> + + @see com::sun::star::sdbc::XConnection + */ +published interface XPooledConnection: com::sun::star::uno::XInterface +{ + + /** return the connection which is pooled + @returns + the pooled Connection object + @throws SQLException + if a database access error occurs. + */ + XConnection getConnection() + raises (SQLException); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XPreparedBatchExecution.idl b/offapi/com/sun/star/sdbc/XPreparedBatchExecution.idl new file mode 100644 index 000000000..1fab832d1 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XPreparedBatchExecution.idl @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XPreparedBatchExecution_idl__ +#define __com_sun_star_sdbc_XPreparedBatchExecution_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is used for batch execution on PreparedStatements. + + + <p> + A + com::sun::star::sdbc::PreparedStatement + uses one precompiled SQL Statement. In batch execution + it is possible to set collection of parameter settings, which are executed in + one batch job. + </p> + */ +published interface XPreparedBatchExecution: com::sun::star::uno::XInterface +{ + + /** adds a set of parameters to the batch. + @throws SQLException + if a database access error occurs. + */ + void addBatch() raises (SQLException); + + /** makes the set of commands in the current batch empty. + @throws SQLException + if a database access error occurs. + */ + void clearBatch() raises (SQLException); + + /** submits a batch of commands to the database for execution. + @returns + an array of update counts containing one element for each + command in the batch. The array is ordered according to the order in + which commands were inserted into the batch. + @throws SQLException + if a database access error occurs. + */ + sequence<long> executeBatch() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XPreparedStatement.idl b/offapi/com/sun/star/sdbc/XPreparedStatement.idl new file mode 100644 index 000000000..485a68603 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XPreparedStatement.idl @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XPreparedStatement_idl__ +#define __com_sun_star_sdbc_XPreparedStatement_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; + published interface XResultSet; + + +/** provides the possibility of executing a precompiled SQL statement. + + + <p> + A SQL statement is pre-compiled and stored in a PreparedStatement object. + This object can then be used to efficiently execute this statement multiple + times. + </p> + */ +published interface XPreparedStatement: com::sun::star::uno::XInterface +{ + + /** executes the SQL query in this + <code>PreparedStatement</code> + object and returns the result set generated by the query. + @returns + the ResultSet object + @throws SQLException + if a database access error occurs. + */ + XResultSet executeQuery() raises (SQLException); + + /** executes the SQL INSERT, UPDATE or DELETE statement in this + com::sun::star::sdbc::PreparedStatement + object. + <br/> + In addition, SQL statements that return nothing, such as + SQL DDL statements, can be executed. + @returns + either the row count for INSERT, UPDATE or DELETE statements; or 0 for SQL statements that return nothing + @throws SQLException + if a database access error occurs. + */ + long executeUpdate() raises (SQLException); + + /** executes any kind of SQL statement. + + + <p> + Some prepared statements return multiple results; the execute + method handles these complex statements as well as the simpler + form of statements handled by executeQuery and executeUpdate. + </p> + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean execute() raises (SQLException); + + /** returns the + com::sun::star::sdbc::Connection + object + that produced this + com::sun::star::sdbc::Statement + object. + @returns + the Connection object + @throws SQLException + if a database access error occurs. + */ + XConnection getConnection() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XRef.idl b/offapi/com/sun/star/sdbc/XRef.idl new file mode 100644 index 000000000..8f897429e --- /dev/null +++ b/offapi/com/sun/star/sdbc/XRef.idl @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XRef_idl__ +#define __com_sun_star_sdbc_XRef_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is the reference to a SQL structured type value in the database. A + Ref can be saved to persistent storage. A Ref is dereferenced by + passing it as a parameter to a SQL statement and executing the + statement. + */ +published interface XRef: com::sun::star::uno::XInterface +{ + + /** gets the fully-qualified SQL structured type name of the referenced item. + @returns + the base type name + @throws SQLException + if a database access error occurs. + */ + string getBaseTypeName() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XResultSet.idl b/offapi/com/sun/star/sdbc/XResultSet.idl new file mode 100644 index 000000000..d49e33757 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XResultSet.idl @@ -0,0 +1,310 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XResultSet_idl__ +#define __com_sun_star_sdbc_XResultSet_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XStatement; + + +/** provides the navigation on a table of data. A + com::sun::star::sdbc::ResultSet + object is usually generated by executing a + com::sun::star::sdbc::Statement. + + + <p> + A ResultSet maintains a cursor pointing to its current row of + data. Initially the cursor is positioned before the first row. + The "next" method moves the cursor to the next row. + </p> + */ +published interface XResultSet: com::sun::star::uno::XInterface +{ + + /** moves the cursor down one row from its current position. + + + <p> + A ResultSet cursor is initially positioned before the first row; the + first call to next makes the first row the current row; the + second call makes the second row the current row, and so on. + </p> + <p>If an input stream is open for the current row, a call + to the method + <code>next</code> + will implicitly close it. + The ResultSet's warning chain is cleared when a new row is read. + </p> + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean next() raises (SQLException); + + /** indicates whether the cursor is before the first row in the result + set. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isBeforeFirst() raises (SQLException); + + /** indicates whether the cursor is after the last row in the result + set. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isAfterLast() raises (SQLException); + + /** indicates whether the cursor is on the first row of the result set. + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isFirst() raises (SQLException); + + /** indicates whether the cursor is on the last row of the result set. + + + <p> + <B> + Note: + </B> + Calling the method + <code>isAtLast</code> + may be expensive because the SDBC driver might need to fetch ahead one row in order + to determine whether the current row is the last row in the result set. + </p> + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isLast() raises (SQLException); + + /** moves the cursor to the front of the result set, just before the + first row. Has no effect if the result set contains no rows. + @throws SQLException + if a database access error occurs. + */ + void beforeFirst() raises (SQLException); + + /** moves the cursor to the end of the result set, just after the last + row. Has no effect if the result set contains no rows. + @throws SQLException + if a database access error occurs. + */ + void afterLast() raises (SQLException); + + /** moves the cursor to the first row in the result set. + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean first() raises (SQLException); + + /** moves the cursor to the last row in the result set. + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean last() raises (SQLException); + + /** retrieves the current row number. The first row is number 1, the + second number 2, and so on. + @returns + the current position + @throws SQLException + if a database access error occurs. + */ + long getRow() raises (SQLException); + + /** moves the cursor to the given row number in the result set. + + + <p> + If the row number is positive, the cursor moves to + the given row number with respect to the + beginning of the result set. The first row is row 1, the second + is row 2, and so on. + </p> + <p> + If the given row number is negative, the cursor moves to + an absolute row position with respect to + the end of the result set. For example, calling + <code>absolute(-1)</code> + positions the + cursor on the last row, + <code>absolute(-2)</code> + indicates the next-to-last row, and so on. + </p> + <p> + An attempt to position the cursor beyond the first/last row in + the result set leaves the cursor before/after the first/last + row, respectively. + </p> + <p> + Note: Calling + <code>absolute(1)</code> + is the same as calling com::sun::star::sdbc::XResultSet::first(). + Calling <code>moveToPosition(-1)</code> is the same as calling + <code>moveToLast()</code>. + </p> + */ + boolean absolute([in] long row ) raises (SQLException); + + /** moves the cursor a relative number of rows, either positive or negative. + + + <p> + Attempting to move beyond the first/last row in the result set + positions the cursor before/after + the first/last row. Calling + <code>relative(0)</code> + is valid, but does not change the cursor position. + </p> + <p> + Note: Calling + <code>relative(1)</code> + is different from calling + com::sun::star::sdbc::XResultSet::next() + because is makes sense to call + <code>next()</code> + when there is no current row, for example, when the cursor is positioned before + the first row or after the last row of the result set. + </p> + @param rows + how many rows should be moved relative to the current row + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean relative([in]long rows) raises (SQLException); + + /** moves the cursor to the previous row in the result set. + + + <p> + Note: + <code>previous()</code> + is not the same as + <code>relative(-1)</code> + because it makes sense to call + <code>previous()</code> + when there is no current row. + </p> + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean previous() raises (SQLException); + + /** refreshes the current row with its most recent value in + the database. Cannot be called when on the insert row. + The + <code>refreshRow</code> + method provides a way for an application to + explicitly tell the SDBC driver to refetch a row(s) from the + database. An application may want to call + <code>refreshRow</code> + when caching or prefetching is being done by the SDBC driver to + fetch the latest value of a row from the database. The SDBC driver + may actually refresh multiple rows at once if the fetch size is + greater than one. + All values are refetched subject to the transaction isolation + level and cursor sensitivity. If + <code>refreshRow</code> + is called after calling + <code>updateXXX</code> + , but before calling + com::sun::star::sdbc::XResultSet::updateRow() + , then the updates made to the row are lost. + Calling the method + <code>refreshRow</code> + frequently will likely slow performance. + @throws SQLException + if a database access error occurs. + */ + void refreshRow() raises (SQLException); + + /** indicates whether the current row has been updated. The value returned + depends on whether or not the result set can detect updates. + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean rowUpdated() raises (SQLException); + + /** indicates whether the current row has had an insertion. The value returned + depends on whether or not the result set can detect visible inserts. + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean rowInserted() raises (SQLException); + + /** indicates whether a row has been deleted. A deleted row may leave + a visible "hole" in a result set. This method can be used to + detect holes in a result set. The value returned depends on whether + or not the result set can detect deletions. + @returns + `TRUE` if successful + @throws SQLException + if a database access error occurs. + */ + boolean rowDeleted() raises (SQLException); + + /** returns the Statement that produced this + com::sun::star::sdbc::ResultSet + object. If the result set was generated some other way, such as by an + com::sun::star::sdbc::XDatabaseMetaData + method, this method returns `NULL`. + @returns + the statement object + @throws SQLException + if a database access error occurs. + */ + com::sun::star::uno::XInterface getStatement() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XResultSetMetaData.idl b/offapi/com/sun/star/sdbc/XResultSetMetaData.idl new file mode 100644 index 000000000..77bf257d7 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XResultSetMetaData.idl @@ -0,0 +1,255 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XResultSetMetaData_idl__ +#define __com_sun_star_sdbc_XResultSetMetaData_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** can be used to find out about the types and properties + of the columns in a ResultSet. + */ +published interface XResultSetMetaData: com::sun::star::uno::XInterface +{ + + /** returns the number of columns in this ResultSet. + @returns + the column count + @throws SQLException + if a database access error occurs. + */ + long getColumnCount() raises (SQLException); + + /** indicates whether the column is automatically numbered, thus read-only. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isAutoIncrement([in]long column) raises (SQLException); + + /** indicates whether a column's case matters. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isCaseSensitive([in]long column) raises (SQLException); + + /** indicates whether the column can be used in a where clause. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isSearchable([in]long column) raises (SQLException); + + /** indicates whether the column is a cash value. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isCurrency([in]long column) raises (SQLException); + + /** indicates the nullability of values in the designated column.@see com::sun::star::sdbc::ColumnValue + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + long isNullable([in]long column) raises (SQLException); + + /** indicates whether values in the column are signed numbers. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isSigned([in]long column) raises (SQLException); + + /** indicates the column's normal max width in chars. + @param column + the first column is 1, the second is 2, + @returns + the normal maximum number of characters allowed as the width of the designated column + @throws SQLException + if a database access error occurs. + */ + long getColumnDisplaySize([in]long column) raises (SQLException); + + /** gets the suggested column title for use in printouts and + displays. + @param column + the first column is 1, the second is 2, + @returns + the suggested column title + @throws SQLException + if a database access error occurs. + */ + string getColumnLabel([in]long column) raises (SQLException); + + /** gets a column's name. + @param column + the first column is 1, the second is 2, + @returns + the column name + @throws SQLException + if a database access error occurs. + */ + string getColumnName([in]long column) raises (SQLException); + + /** gets a column's table's schema. + @param column + the first column is 1, the second is 2, + @returns + the schema name + @throws SQLException + if a database access error occurs. + */ + string getSchemaName([in]long column) raises (SQLException); + + /** gets a column's number of decimal digits. + @param column + the first column is 1, the second is 2, + @returns + precision + @throws SQLException + if a database access error occurs. + */ + long getPrecision([in]long column) raises (SQLException); + + /** gets a column's number of digits to right of the decimal point. + @param column + the first column is 1, the second is 2, + @returns + scale + @throws SQLException + if a database access error occurs. + */ + long getScale([in]long column) raises (SQLException); + + /** gets a column's table name. + @param column + the first column is 1, the second is 2, + @returns + the table name + @throws SQLException + if a database access error occurs. + */ + string getTableName([in]long column) raises (SQLException); + + /** gets a column's table's catalog name. + @param column + the first column is 1, the second is 2, + @returns + the catalog name + @throws SQLException + if a database access error occurs. + */ + string getCatalogName([in]long column) raises (SQLException); + + /** retrieves a column's SQL type. + @param column + the first column is 1, the second is 2, + @returns + the column type + @throws SQLException + if a database access error occurs. + */ + long getColumnType([in]long column) raises (SQLException); + + /** retrieves a column's database-specific type name. + @param column + the first column is 1, the second is 2, + @returns + the type name + @throws SQLException + if a database access error occurs. + */ + string getColumnTypeName([in]long column) raises (SQLException); + + /** indicates whether a column is definitely not writable. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isReadOnly([in]long column) raises (SQLException); + + /** indicates whether it is possible for a write on the column to succeed. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isWritable([in]long column) raises (SQLException); + + /** indicates whether a write on the column will definitely succeed. + @param column + the first column is 1, the second is 2, + @returns + `TRUE` if so + @throws SQLException + if a database access error occurs. + */ + boolean isDefinitelyWritable([in]long column) raises (SQLException); + + /** returns the fully-qualified name of the service whose instances + are manufactured if the method + com::sun::star::sdbc::XResultSet::.getObject() + is called to retrieve a value from the column. + @param column + the first column is 1, the second is 2, + @returns + the service name + @throws SQLException + if a database access error occurs. + */ + string getColumnServiceName([in]long column) raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XResultSetMetaDataSupplier.idl b/offapi/com/sun/star/sdbc/XResultSetMetaDataSupplier.idl new file mode 100644 index 000000000..b120ca624 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XResultSetMetaDataSupplier.idl @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XResultSetMetaDataSupplier_idl__ +#define __com_sun_star_sdbc_XResultSetMetaDataSupplier_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XResultSetMetaData; + + +/** provides access to the meta data of a result set. + + + <p> + The number, types, and properties of a ResultSet's columns are + provided by the + com::sun::star::sdbc::XResultSetMetaData + interface returned by the + com::sun::star::sdbc::XResultSetMetaDataSupplier::getMetaData() + method. + </p> + */ +published interface XResultSetMetaDataSupplier: com::sun::star::uno::XInterface +{ + + /** retrieves the number, types, and properties of a ResultSet's columns. + @returns + the meta data of the ResultSet. + @throws SQLException + if a database access error occurs. + */ + XResultSetMetaData getMetaData() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XResultSetUpdate.idl b/offapi/com/sun/star/sdbc/XResultSetUpdate.idl new file mode 100644 index 000000000..a6f2ac576 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XResultSetUpdate.idl @@ -0,0 +1,126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XResultSetUpdate_idl__ +#define __com_sun_star_sdbc_XResultSetUpdate_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** provides the possibility to write changes made on a result set back to + database. + */ +published interface XResultSetUpdate: com::sun::star::uno::XInterface +{ + + /** inserts the contents of the insert row into the result set and + the database. Must be on the insert row when this method is called. + @throws SQLException + if a database access error occurs. + */ + void insertRow() raises (SQLException); + + /** updates the underlying database with the new contents of the + current row. Cannot be called when on the insert row. + @throws SQLException + if a database access error occurs. + */ + void updateRow() raises (SQLException); + + /** deletes the current row from the result set and the underlying + database. Cannot be called when on the insert row. + @throws SQLException + if a database access error occurs. + */ + void deleteRow() raises (SQLException); + + /** cancels the updates made to a row. + + + <p> + This method may be called after calling an + <code>updateXXX</code> + method(s) and before calling + com::sun::star::sdbc::XResultSetUpdate::updateRow() + to rollback the updates made to a row. If no updates have been made or + <code>updateRow</code> + has already been called, then this method has no + effect. + </p> + @throws SQLException + if a database access error occurs. + */ + void cancelRowUpdates() raises (SQLException); + + /** moves the cursor to the insert row. The current cursor position is + remembered while the cursor is positioned on the insert row. + + + <p> + The insert row is a special row associated with an updatable + result set. It is essentially a buffer where a new row may + be constructed by calling the + <code>updateXXX</code> + methods prior to + inserting the row into the result set. + </p> + <p> + Only the + <code>updateXXX</code> + , + <code>getXXX</code> + , + and + com::sun::star::sdbc::XResultSetUpdate::insertRow() + methods may be + called when the cursor is on the insert row. All of the columns in + a result set must be given a value each time this method is + called before calling + <code>insertRow</code> + . The method + <code>updateXXX</code> + must be called before a + <code>getXXX</code> + method can be called on a column value. + </p> + @throws SQLException + if a database access error occurs. + */ + void moveToInsertRow() raises (SQLException); + + /** moves the cursor to the remembered cursor position, usually the + current row. This method has no effect if the cursor is not on the insert + row. + @throws SQLException + if a database access error occurs. + */ + void moveToCurrentRow() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XRow.idl b/offapi/com/sun/star/sdbc/XRow.idl new file mode 100644 index 000000000..9a2912dc4 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XRow.idl @@ -0,0 +1,312 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XRow_idl__ +#define __com_sun_star_sdbc_XRow_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/util/Date.idl> + +#include <com/sun/star/util/DateTime.idl> + +#include <com/sun/star/util/Time.idl> + + module com { module sun { module star { module io { + published interface XInputStream; +};};};}; + + module com { module sun { module star { module container { + published interface XNameAccess; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XRef; + published interface XArray; + published interface XBlob; + published interface XClob; + + +/** is used to access data which is collected in a row. + All methods raise a + com::sun::star::sdbc::SQLException + if a database access error occurs. + */ +published interface XRow: com::sun::star::uno::XInterface +{ + + /** reports whether the last column read had a value of SQL NULL. + Note that you must first call getXXX on a column to try to read + its value and then call wasNull() to see if the value read was + SQL NULL. + + @returns + `TRUE` if last column read was SQL NULL and `FALSE` otherwise + @throws SQLException + if a database access error occurs. + */ + boolean wasNull() raises (SQLException); + + /** gets the value of a column in the current row as a string. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + string getString([in]long columnIndex) raises (SQLException); + + /** gets the value of a column in the current row as boolean. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + boolean getBoolean([in]long columnIndex) raises (SQLException); + + /** get the value of a column in the current row as a byte. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + byte getByte([in]long columnIndex) raises (SQLException); + + /** gets the value of a column in the current row as a short. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + short getShort([in]long columnIndex) raises (SQLException); + + /** get the value of a column in the current row as an integer. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + long getInt([in]long columnIndex) raises (SQLException); + + /** get the value of a column in the current row as a long. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + hyper getLong([in]long columnIndex) raises (SQLException); + + /** gets the value of a column in the current row as a float. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + float getFloat([in]long columnIndex) raises (SQLException); + + /** gets the value of a column in the current row as a double. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + double getDouble([in]long columnIndex) raises (SQLException); + + /** gets the value of a column in the current row as a byte array. + The bytes represent the raw values returned by the driver. + @param columnIndex + the first column is 1, the second is 2, ... + @returns + the column value; if the value is SQL NULL, the result is empty. + @throws SQLException + if a database access error occurs. + */ + sequence<byte> getBytes([in]long columnIndex) raises (SQLException); + + /** gets the value of a column in the current row as a date object. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + com::sun::star::util::Date getDate([in]long columnIndex) + raises (SQLException); + + /** gets the value of a column in the current row as a time object. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + com::sun::star::util::Time getTime([in]long columnIndex) + raises (SQLException); + + /** gets the value of a column in the current row as a datetime object. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + com::sun::star::util::DateTime getTimestamp([in]long columnIndex) + raises (SQLException); + + /** gets the value of a column in the current row as a stream of + uninterpreted bytes. The value can then be read in chunks from the + stream. This method is particularly suitable for retrieving large + LONGVARBINARY values. + + + <p> + <b>Note:</b> All the data in the returned stream must be + read prior to getting the value of any other column. The next + call to a get method implicitly closes the stream. Also, a + stream may return 0 when the method + com::sun::star::io::XInputStream::available() + is called whether there is data + available or not. + </p> + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + com::sun::star::io::XInputStream getBinaryStream([in]long columnIndex) + raises (SQLException); + + /** gets the value of a column in the current row as a stream of + uninterpreted bytes. The value can then be read in chunks from the + stream. This method is particularly suitable for retrieving large + LONGVARBINARY or LONGVARCHAR values. + + + <p> + <b>Note:</b> All the data in the returned stream must be + read prior to getting the value of any other column. The next + call to a get method implicitly closes the stream. Also, a + stream may return 0 when the method + com::sun::star::io::XInputStream::available() + is called whether there is data + available or not. + </p> + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + com::sun::star::io::XInputStream getCharacterStream([in]long columnIndex) + raises (SQLException); + + /** returns the value of a column in the current row as an object. + This method uses the given + <code>Map</code> + object for the custom mapping of the SQL structure or distinct type + that is being retrieved. + @param columnIndex + the first column is 1, the second is 2, + @param typeMap + the map of types which should be used to get the column value + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + any getObject([in]long columnIndex, + [in]com::sun::star::container::XNameAccess typeMap) + raises (SQLException); + + /** gets a REF(&lt;structured-type&gt;) column value from the current row. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + XRef getRef([in]long columnIndex) raises (SQLException); + + /** gets a BLOB value in the current row. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + XBlob getBlob([in]long columnIndex) raises (SQLException); + + /** gets a CLOB value in the current row of this + <code>ResultSet</code> + object. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + XClob getClob([in]long columnIndex) raises (SQLException); + + /** gets a SQL ARRAY value from the current row of this + <code>ResultSet</code> + object. + @param columnIndex + the first column is 1, the second is 2, + @returns + the column value; if the value is SQL NULL, the result is null + @throws SQLException + if a database access error occurs. + */ + XArray getArray([in]long columnIndex) raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XRowSet.idl b/offapi/com/sun/star/sdbc/XRowSet.idl new file mode 100644 index 000000000..cb647e337 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XRowSet.idl @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XRowSet_idl__ +#define __com_sun_star_sdbc_XRowSet_idl__ + +#include <com/sun/star/sdbc/XResultSet.idl> + + module com { module sun { module star { module sdbc { + + published interface XRowSetListener; + published interface XConnection; + + +/** enhances the functionality of a result set. It allows implementation of + a special behavior for a result set and notifies an application on + certain row set events such as a change in its value. + + + + <p> + The XRowSet interface is unique in that it is intended to be + a software layer on top of an SDBC driver. Implementations of the + RowSet interface can be provided by anyone. + </p> + */ +published interface XRowSet: XResultSet +{ + + /** populates a row set with data. The description of the data source and + other important information for filling the row set with data. + + @throws SQLException + if a database access error occurs. + */ + void execute() raises (SQLException); + + /** adds the specified listener to receive the events "cursorMoved", + "rowChanged", and "rowSetChanged". + @param listener + the listener which should be registered + */ + void addRowSetListener([in]XRowSetListener listener ); + + /** removes the specified listener. + @param listener + the listener which should be registered + */ + void removeRowSetListener([in]XRowSetListener listener ); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XRowSetListener.idl b/offapi/com/sun/star/sdbc/XRowSetListener.idl new file mode 100644 index 000000000..5eb7afe62 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XRowSetListener.idl @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XRowSetListener_idl__ +#define __com_sun_star_sdbc_XRowSetListener_idl__ + +#include <com/sun/star/lang/XEventListener.idl> + + module com { module sun { module star { module sdbc { + + +/** is used for receiving "cursorMoved", "rowChanged", and "rowSetChanged" events + posted by, for example, a row set. + */ +published interface XRowSetListener: com::sun::star::lang::XEventListener +{ + + /** is called when a row set's cursor is moved. + @param event + contains information about the event + */ + void cursorMoved([in]com::sun::star::lang::EventObject event); + + /** is called when a row is inserted, updated, or deleted. + @param event + contains information about the event + @deprecated + @see com::sun::star::sdb::XRowsChangeListener + */ + void rowChanged([in]com::sun::star::lang::EventObject event); + + /** is called when the row set has changed, or in other words, when the row set has + been reexecuted. + @param event + contains information about the event + */ + void rowSetChanged([in]com::sun::star::lang::EventObject event); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XRowUpdate.idl b/offapi/com/sun/star/sdbc/XRowUpdate.idl new file mode 100644 index 000000000..dcc90ed55 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XRowUpdate.idl @@ -0,0 +1,236 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XRowUpdate_idl__ +#define __com_sun_star_sdbc_XRowUpdate_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/util/Date.idl> + +#include <com/sun/star/util/DateTime.idl> + +#include <com/sun/star/util/Time.idl> + + module com { module sun { module star { module io { + published interface XInputStream; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is used to update data which is collected in a row. + */ +published interface XRowUpdate: com::sun::star::uno::XInterface +{ + + /** gives a nullable column a null value. + @param columnIndex + the position of the column + @throws SQLException + if a database access error occurs. + */ + void updateNull([in]long columnIndex) raises (SQLException); + + /** updates a column with a boolean value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateBoolean([in]long columnIndex, [in]boolean x) raises (SQLException); + + /** updates a column with a byte value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateByte([in]long columnIndex, [in]byte x) raises (SQLException); + + /** updates a column with a short value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateShort([in]long columnIndex, [in]short x) raises (SQLException); + + /** updates a column with an long value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateInt([in]long columnIndex, [in]long x) raises (SQLException); + + /** updates a column with a hyper value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateLong([in]long columnIndex, [in]hyper x) raises (SQLException); + + /** updates a column with a float value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateFloat([in]long columnIndex, [in]float x) raises (SQLException); + + /** updates a column with a double value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateDouble([in]long columnIndex, [in]double x) raises (SQLException); + + /** updates a column with a string value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateString([in]long columnIndex, [in]string x) raises (SQLException); + + /** updates a column with a byte array value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateBytes([in]long columnIndex, [in]sequence<byte> x) raises (SQLException); + + /** updates a column with a date value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateDate([in]long columnIndex, [in]com::sun::star::util::Date x) + raises (SQLException); + + /** updates a column with a time value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateTime([in]long columnIndex, [in]com::sun::star::util::Time x) + raises (SQLException); + + /** updates a column with a timestamp value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateTimestamp([in]long columnIndex, + [in]com::sun::star::util::DateTime x) + raises (SQLException); + + /** updates a column with a stream value. + @param columnIndex + the position of the column + @param x + the new column value + @param length + how much data should be read out of the stream + @throws SQLException + if a database access error occurs. + */ + void updateBinaryStream([in]long columnIndex, + [in]com::sun::star::io::XInputStream x, + [in]long length) raises (SQLException); + + /** updates a column with a stream value. + @param columnIndex + the position of the column + @param x + the new column value + @param length + how much data should be read out of the stream + @throws SQLException + if a database access error occurs. + */ + void updateCharacterStream([in]long columnIndex, + [in]com::sun::star::io::XInputStream x, + [in]long length) raises (SQLException); + + /** updates a column with an object value. + @param columnIndex + the position of the column + @param x + the new column value + @throws SQLException + if a database access error occurs. + */ + void updateObject([in]long columnIndex, [in]any x) + raises (SQLException); + + /** updates a column with an object value. + @param columnIndex + the position of the column + @param x + the new column value + @param scale + defines the scale which should be used to write the numeric value + @throws SQLException + if a database access error occurs. + */ + void updateNumericObject([in]long columnIndex, [in]any x, [in]long scale) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XSQLData.idl b/offapi/com/sun/star/sdbc/XSQLData.idl new file mode 100644 index 000000000..b187437d3 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XSQLData.idl @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XSQLData_idl__ +#define __com_sun_star_sdbc_XSQLData_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XSQLInput; + published interface XSQLOutput; + + +/** is used for the custom mapping of SQL user-defined types. + + + <p> + This interface must be implemented by a service that is + registered in a type mapping. It is expected that this interface + will normally be implemented by a tool. The methods in this interface + are called by the driver and are never called by a programmer + directly. + </p> + */ +published interface XSQLData: com::sun::star::uno::XInterface +{ + + /** returns the fully-qualified name of the SQL user-defined type + that this object represents. + + + <p> + This method is called by the SDBC driver to get the name of the + UDT instance that is being mapped to this instance of SQLData. + </p> + @returns + the name of the SQL type. + @throws SQLException + if a database access error occurs. + */ + string getSQLTypeName() raises (SQLException); + + + /** populates this object with data read from the database. + + + <p> + The implementation of the method must follow this protocol: + <br/> + It must read each of the attributes or elements of the SQL + type from the given input stream. This is done + by calling a method of the input stream to read each + item, in the order that they appear in the SQL definition + of the type. The method + <code>readSQL</code> + then assigns the data to appropriate fields or elements (of this + or other objects). + <br/> + Specifically, it must call the appropriate + <code>XSQLInput.readXXX</code> + method(s) to do the following: + for a Distinct Type, read its single data element; + for a Structured Type, read a value for each attribute of the SQL type. + </p> + <p> + The SDBC driver initializes the input stream with a type map + before calling this method, which is used by the appropriate + <code>SQLInput.readXXX</code> + method on the stream. + </p> + + @param stream + the input SQL data stream + @param typeName + the SQL type of the value on the data stream + @throws SQLException + if a database access error occurs. + + @see com::sun::star::sdbc::XSQLInput + */ + void readSQL([in]XSQLInput stream, [in]string typeName) + raises (SQLException); + + /** writes this object to the given SQL data stream. + + + <p> + The implementation of the method must follow this protocol: + <br/> + It must write each of the attributes of the SQL type to the given output + stream. This is done by calling a method of the output stream to write + each item, in the order that they appear in the SQL definition of the type. + Specifically, it must call the appropriate + <code>XSQLOutput.writeXXX</code> + method(s) to do the following:<br> + for a Distinct Type, write its single data element; + for a Structured Type, write a value for each attribute of the SQL type. + </p> + @param stream + the output SQL data stream + @throws SQLException + if a database access error occurs. + @see com::sun::star::sdbc::XSQLOutput + */ + void writeSQL([in]XSQLOutput stream) raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XSQLInput.idl b/offapi/com/sun/star/sdbc/XSQLInput.idl new file mode 100644 index 000000000..9b3171382 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XSQLInput.idl @@ -0,0 +1,264 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XSQLInput_idl__ +#define __com_sun_star_sdbc_XSQLInput_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/util/Date.idl> + +#include <com/sun/star/util/DateTime.idl> + +#include <com/sun/star/util/Time.idl> + + module com { module sun { module star { module io { + published interface XInputStream; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XRef; + published interface XArray; + published interface XBlob; + published interface XClob; + + +/** represents an input stream that contains a stream of values representing an + instance of a SQL structured or distinct type. + + + <p> + This interface, used only for custom mapping, is used by the driver + behind the scenes, and a programmer never directly invokes + <code>SQLInput</code> + methods. + </p> + <p> + When the method + <code>getObject</code> + is called with an object of a service implementing the interface + <code>SQLData</code> + , the SDBC driver calls the method + com::sun::star::sdbc::XSQLData::getSQLType() + to determine the SQL type of the user-defined type (UDT) being custom mapped. + The driver creates an instance of + com::sun::star::sdbc::XSQLInput + , + populating it with the attributes of the UDT. The driver then passes the input + stream to the method + com::sun::star::sdbc::XSQLData::readSQL() + , which in turn calls the + <code>XSQLInput.readXXX</code> + methods in its implementation for reading the attributes from the input stream. + </p> + */ +published interface XSQLInput: com::sun::star::uno::XInterface +{ + + /** reads the next attribute in the stream as string. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + string readString() raises (SQLException); + + /** reads the next attribute in the stream as boolean. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + boolean readBoolean() raises (SQLException); + + /** reads the next attribute in the stream as byte. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + byte readByte() raises (SQLException); + + /** reads the next attribute in the stream as short. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + short readShort() raises (SQLException); + + /** reads the next attribute in the stream as long. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + long readInt() raises (SQLException); + + /** reads the next attribute in the stream as hyper. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + hyper readLong() raises (SQLException); + + /** reads the next attribute in the stream as float. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + float readFloat() raises (SQLException); + + /** reads the next attribute in the stream as double. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + double readDouble() raises (SQLException); + + /** reads the next attribute in the stream as sequence of bytes. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + sequence<byte> readBytes() raises (SQLException); + + /** reads the next attribute in the stream as date. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + com::sun::star::util::Date readDate() raises (SQLException); + + /** reads the next attribute in the stream as time. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + com::sun::star::util::Time readTime() raises (SQLException); + + /** reads the next attribute in the stream as datetime. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + com::sun::star::util::DateTime readTimestamp() raises (SQLException); + + /** reads the next attribute in the stream as sequence of bytes. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + com::sun::star::io::XInputStream readBinaryStream() raises (SQLException); + + /** reads the next attribute in the stream as a Unicode string. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + com::sun::star::io::XInputStream readCharacterStream() raises (SQLException); + + /** returns the datum at the head of the stream as an any. + + + <p> + The actual type of the any returned is determined by the default + type mapping, and any customizations present in this stream's type map. + + <br/> + A type map is registered with the stream by the SDBC driver before the + stream is passed to the application. + + <br/> + When the datum at the head of the stream is a SQL NULL, + the method returns `VOID`. If the datum is a SQL structured or distinct + type, it determines the SQL type of the datum at the head of the stream, + constructs an object of the appropriate service, and calls the method + com::sun::star::sdbc::XSQLData::readSQL() + on that object, which reads additional data + from the stream using the protocol described for that method. + + </p> + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + any readObject() raises (SQLException); + + /** reads a REF(&lt;structured-type&gt;) from the stream. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + XRef readRef() raises (SQLException); + + /** reads a BLOB from the stream. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + XBlob readBlob() raises (SQLException); + + /** reads a CLOB from the stream. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + XClob readClob() raises (SQLException); + + /** reads an array from the stream. + @returns + the attribute; if the value is SQL NULL, return null. + @throws SQLException + if a database access error occurs. + */ + XArray readArray() raises (SQLException); + + /** determines whether the last value read was null. + @returns + `TRUE` if the most recently gotten SQL value was null; otherwise, `FALSE` + @throws SQLException + if a database access error occurs. + */ + boolean wasNull() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XSQLOutput.idl b/offapi/com/sun/star/sdbc/XSQLOutput.idl new file mode 100644 index 000000000..c454ecaee --- /dev/null +++ b/offapi/com/sun/star/sdbc/XSQLOutput.idl @@ -0,0 +1,274 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XSQLOutput_idl__ +#define __com_sun_star_sdbc_XSQLOutput_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/util/Date.idl> + +#include <com/sun/star/util/DateTime.idl> + +#include <com/sun/star/util/Time.idl> + + module com { module sun { module star { module io { + published interface XInputStream; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XRef; + published interface XArray; + published interface XBlob; + published interface XClob; + published interface XStruct; + published interface XSQLData; + + +/** is used as an output stream for writing the attributes of a user-defined + type back to the database. This interface, used only for custom mapping, + is used by the driver, and its methods are never directly invoked + by a programmer. + + + <p> + When an object of a class implementing interface + com::sun::star::sdbc::XSQLData + is passed as an argument to a SQL statement, the JDBC driver calls + com::sun::star::sdbc::SQLData::getSQLType() + to determine the kind of SQL datum being passed to the database. + <br/> + The driver then creates an instance of + <code>XSQLOutput</code> + and passes it to the method + com::sun::star::sdbc::XSQLData::writeSQL() + . The method + <code>writeSQL</code> + in turn calls the appropriate + <code>XSQLOutput.writeXXX</code> + methods to write data from the + com::sun::star::sdbc::XSQLData + object to the + <code>XSQLOutput</code> + output stream as the representation of a SQL user-defined type.</p> + */ +published interface XSQLOutput: com::sun::star::uno::XInterface +{ + + /** writes the next attribute to the stream as a string. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeString([in]string x) raises (SQLException); + + /** writes the next attribute to the stream as boolean. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeBoolean([in]boolean x) raises (SQLException); + + /** writes the next attribute to the stream as byte. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeByte([in]byte x) raises (SQLException); + + /** writes the next attribute to the stream as short. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeShort([in]short x) raises (SQLException); + + /** writes the next attribute to the stream as long. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeInt([in]long x) raises (SQLException); + + /** writes the next attribute to the stream as hyper. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeLong([in]hyper x) raises (SQLException); + + /** writes the next attribute to the stream as float. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeFloat([in]float x) raises (SQLException); + + /** writes the next attribute to the stream as double. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeDouble([in]double x) raises (SQLException); + + /** writes the next attribute to the stream as byte sequence. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeBytes([in]sequence<byte> x) raises (SQLException); + + /** writes the next attribute to the stream as a date. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeDate([in]com::sun::star::util::Date x) raises (SQLException); + + /** writes the next attribute to the stream as a time. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeTime([in]com::sun::star::util::Time x) raises (SQLException); + + /** writes the next attribute to the stream as a datetime. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeTimestamp([in]com::sun::star::util::DateTime x) + raises (SQLException); + + /** writes the next attribute to the stream as a stream of uninterpreted + bytes. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeBinaryStream([in]com::sun::star::io::XInputStream x) + raises (SQLException); + + /** writes the next attribute to the stream as a stream of Unicode string. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeCharacterStream([in]com::sun::star::io::XInputStream x) + raises (SQLException); + + /** writes to the stream the data contained in the given + <code>XSQLData</code> object. + + + <p + >When the + <code>XSQLData</code> + object is + `NULL` + , this method writes an SQL NULL to the stream. + Otherwise, it calls the + com::sun::star::sdbc::XSQLData::writeSQL() + method of the given object, which + writes the object's attributes to the stream. + The implementation of the method + <code>XSQLData::writeSQL()</code> + calls the appropriate + <code>XSQLOutput.writeXXX</code> + method(s) for writing each of the object's attributes in order. + <br/> + The attributes must be read from an + com::sun::star::sdbc::XSQLInput + input stream and written to an + <code>XSQLOutput</code> + output stream in the same order in which they were + listed in the SQL definition of the user-defined type. + </p> + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeObject([in]XSQLData x) raises (SQLException); + + /** writes a REF(&lt;structured-type&gt;) to the stream. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeRef([in]XRef x) raises (SQLException); + + /** writes a BLOB to the stream. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeBlob([in]XBlob x) raises (SQLException); + + /** writes a CLOB to the stream. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeClob([in]XClob x) raises (SQLException); + + /** writes a structured-type to the stream. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeStruct([in]XStruct x) raises (SQLException); + + /** writes an array to the stream. + @param x + the value to pass to the database. + @throws SQLException + if a database access error occurs. + */ + void writeArray([in]XArray x) raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XStatement.idl b/offapi/com/sun/star/sdbc/XStatement.idl new file mode 100644 index 000000000..4d0ac4bad --- /dev/null +++ b/offapi/com/sun/star/sdbc/XStatement.idl @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XStatement_idl__ +#define __com_sun_star_sdbc_XStatement_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + published interface XConnection; + published interface XResultSet; + + +/** is used for executing a static SQL statement and obtaining the results + produced by it. + + + + <p> + Only one ResultSet per Statement can be open at any point in + time; therefore, if the reading of one ResultSet is interleaved + with the reading of another, each must have been generated by + different Statements. All statement + <code>execute</code> + methods implicitly + close a statement's current ResultSet if an open one exists. + </p> + */ +published interface XStatement: com::sun::star::uno::XInterface +{ + + /** executes a SQL statement that returns a single ResultSet. + @param sql + the SQL statement which should be executed + @returns + a ResultSet that contains the data produced by the query; never `NULL` + @throws SQLException + if a database access error occurs. + */ + XResultSet executeQuery([in]string sql) raises (SQLException); + + /** executes an SQL INSERT, UPDATE, or DELETE statement. In addition, + SQL statements that return nothing, such as SQL DDL statements, + can be executed. + + @param sql + a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing + @returns + either the row count for INSERT, UPDATE or DELETE or 0 for SQL statements that return nothing + @throws SQLException + if a database access error occurs. + */ + long executeUpdate([in]string sql) raises (SQLException); + + /** executes a SQL statement that may return multiple results. + + + <p> + Under some (uncommon) situations a single SQL statement may return + multiple result sets and/or update counts. Normally you can ignore + this unless you are (1) executing a stored procedure that you know may + return multiple results or (2) you are dynamically executing an + unknown SQL string. The navigation through multiple results is covered by + com::sun::star::sdbc::XMultipleResults. + </p> + <p> + The + <code>execute</code> + method executes a SQL statement and indicates + the form of the first result. You can then use + com::sun::star::sdbc::XMultipleResults::getResultSet() + or + com::sun::star::sdbc::XMultipleResults::getUpdateCount() + to retrieve the result, and + com::sun::star::sdbc::XMultipleResults::getMoreResults() + to move to any subsequent result(s). + </p> + + @param sql + any SQL statement + @returns + `TRUE` if the next result is a ResultSet; `FALSE` if it is an update count or there are no more results + @throws SQLException + if a database access error occurs. + */ + boolean execute([in]string sql) raises (SQLException); + + /** returns the + com::sun::star::sdbc::Connection + object + that produced this + <code>Statement</code> + object. + @returns + the connection that produced this statement + + @throws SQLException + if a database access error occurs. + */ + XConnection getConnection() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XStruct.idl b/offapi/com/sun/star/sdbc/XStruct.idl new file mode 100644 index 000000000..7b512d5ea --- /dev/null +++ b/offapi/com/sun/star/sdbc/XStruct.idl @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XStruct_idl__ +#define __com_sun_star_sdbc_XStruct_idl__ + +#include <com/sun/star/uno/XInterface.idl> + + module com { module sun { module star { module container { + published interface XNameAccess; +};};};}; + +#include <com/sun/star/sdbc/SQLException.idl> + + module com { module sun { module star { module sdbc { + + +/** is used for the standard mapping for a SQL structured type. + + + <p> + A + <code>Struct</code> + object contains a value for each attribute + of the SQL structured type that it represents. + By default, an instance of + <code>Struct</code> + is valid as long as the + application has a reference to it. + </p> + */ +published interface XStruct: com::sun::star::uno::XInterface +{ + + /** retrieves the SQL type name of the SQL structured type + that this + <code>Struct</code> + object represents. + @returns + the name of the SQL type. + @throws SQLException + if a database access error occurs. + */ + string getSQLTypeName() raises (SQLException); + + + /** produces the ordered values of the attributes of the SQL + structured type that this + <code>Struct</code> + object represents. + <p> + This method uses the given type map for customizations of the type + mappings. If there is no entry in the given type map that matches or + the given type map is + `NULL` + , the structured type that this + <code>Struct</code> + object represents, the driver uses + the connection type mapping. + @param typeMap + is a map object that contains mappings of SQL type names to + services. If the + <code>typeMap</code>is + `NULL` + , the type-map + associated with the connection for customizations of the type-mappings + is used. + @returns + an array containing the ordered attribute values. + @throws SQLException + if a database access error occurs. + */ + sequence<any> getAttributes([in]com::sun::star::container::XNameAccess typeMap) + raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdbc/XWarningsSupplier.idl b/offapi/com/sun/star/sdbc/XWarningsSupplier.idl new file mode 100644 index 000000000..9f06ff650 --- /dev/null +++ b/offapi/com/sun/star/sdbc/XWarningsSupplier.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_sdbc_XWarningsSupplier_idl__ +#define __com_sun_star_sdbc_XWarningsSupplier_idl__ + +#include <com/sun/star/uno/XInterface.idl> + +#include <com/sun/star/sdbc/SQLWarning.idl> + + module com { module sun { module star { module sdbc { + + +/** should be implemented of objects which may report warnings or non critical + errors. + @see com::sun::star::sdbc::SQLWarning + */ +published interface XWarningsSupplier: com::sun::star::uno::XInterface +{ + + /** returns the first warning reported by calls on an object that supports + the usage of warnings. + + <p> + <b>Note:</b> Subsequent warnings will be chained to this + com::sun::star::sdbc::SQLWarning. + </p> + @returns + the warnings + @throws SQLException + if a database access error occurs. + */ + any getWarnings() raises (SQLException); + + + /** clears all warnings reported for the object implementing the interface. + After a call to this method, the method + com::sun::star::sdbc::XWarningsSupplier::getWarnings() + returns + `VOID` + until a new warning is reported for the object. + @throws SQLException + if a database access error occurs. + */ + void clearWarnings() raises (SQLException); +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |