1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23#ifndef __com_sun_star_sdbc_XDataSource_idl__ 24#define __com_sun_star_sdbc_XDataSource_idl__ 25 26#ifndef __com_sun_star_uno_XInterface_idl__ 27#include <com/sun/star/uno/XInterface.idl> 28#endif 29 30#ifndef __com_sun_star_sdbc_SQLException_idl__ 31#include <com/sun/star/sdbc/SQLException.idl> 32#endif 33 34 module com { module sun { module star { module sdbc { 35 36 published interface XConnection; 37 38 39/** is used for establishing connections via a factory which is identified 40 by its name. A DataSource object is typically registered by a naming service 41 provider. 42 */ 43published interface XDataSource: com::sun::star::uno::XInterface 44{ 45 //------------------------------------------------------------------------- 46 47 /** attempts to establish a database connection. 48 @param user 49 the user name 50 @param password 51 the password 52 @returns 53 the connection object 54 @throws SQLException 55 if a database access error occurs. 56 */ 57 XConnection getConnection([in]string user, [in]string password) 58 raises (SQLException); 59 //------------------------------------------------------------------------- 60 61 /** sets the maximum time in seconds that this data source will wait 62 while attempting to connect to a database. 63 64 65 <p> 66 A value of zero specifies that the timeout is the default system 67 timeout if there is one; otherwise, it specifies that there is no timeout. 68 When a DataSource object is created the login timeout is initially zero. 69 </p> 70 @param seconds 71 the login time limit in seconds 72 @throws SQLException 73 if a database access error occurs. 74 */ 75 void setLoginTimeout([in]long seconds) 76 raises (SQLException); 77 //------------------------------------------------------------------------- 78 79 /** gets the maximum time in seconds that this data source can wait 80 while attempting to connect to a database. 81 82 83 <p> 84 A value of zero means that the timeout is the default system timeout 85 if there is one; otherwise, it means that there is no timeout. When a 86 DataSource object is created the login timeout is initially zero. 87 </p> 88 @returns 89 the login time limit in seconds 90 @throws SQLException 91 if a database access error occurs. 92 */ 93 long getLoginTimeout() raises (SQLException); 94}; 95 96//============================================================================= 97 98}; }; }; }; 99 100/*=========================================================================== 101===========================================================================*/ 102#endif 103