1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle andor its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_dbaccess.hxx" 30 #include "PrivateRow.hxx" 31 32 using namespace dbaccess; 33 using namespace ::com::sun::star::uno; 34 using namespace ::com::sun::star::beans; 35 using namespace ::com::sun::star::sdbc; 36 using namespace ::com::sun::star::sdb; 37 using namespace ::com::sun::star::sdbcx; 38 using namespace ::com::sun::star::container; 39 using namespace ::com::sun::star::lang; 40 using namespace ::com::sun::star::util; 41 using namespace ::com::sun::star; 42 43 ::sal_Bool SAL_CALL OPrivateRow::wasNull( ) throw (SQLException, RuntimeException) 44 { 45 return m_aRow[m_nPos].isNull(); 46 } 47 ::rtl::OUString SAL_CALL OPrivateRow::getString( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 48 { 49 m_nPos = columnIndex; 50 return m_aRow[m_nPos]; 51 } 52 ::sal_Bool SAL_CALL OPrivateRow::getBoolean( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 53 { 54 m_nPos = columnIndex; 55 return m_aRow[m_nPos]; 56 } 57 ::sal_Int8 SAL_CALL OPrivateRow::getByte( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 58 { 59 m_nPos = columnIndex; 60 return m_aRow[m_nPos]; 61 } 62 ::sal_Int16 SAL_CALL OPrivateRow::getShort( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 63 { 64 m_nPos = columnIndex; 65 return m_aRow[m_nPos]; 66 } 67 ::sal_Int32 SAL_CALL OPrivateRow::getInt( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 68 { 69 m_nPos = columnIndex; 70 return m_aRow[m_nPos]; 71 } 72 ::sal_Int64 SAL_CALL OPrivateRow::getLong( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 73 { 74 m_nPos = columnIndex; 75 return m_aRow[m_nPos]; 76 } 77 float SAL_CALL OPrivateRow::getFloat( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 78 { 79 m_nPos = columnIndex; 80 return m_aRow[m_nPos]; 81 } 82 double SAL_CALL OPrivateRow::getDouble( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 83 { 84 m_nPos = columnIndex; 85 return m_aRow[m_nPos]; 86 } 87 Sequence< ::sal_Int8 > SAL_CALL OPrivateRow::getBytes( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 88 { 89 m_nPos = columnIndex; 90 return m_aRow[m_nPos]; 91 } 92 ::com::sun::star::util::Date SAL_CALL OPrivateRow::getDate( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 93 { 94 m_nPos = columnIndex; 95 return m_aRow[m_nPos]; 96 } 97 ::com::sun::star::util::Time SAL_CALL OPrivateRow::getTime( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 98 { 99 m_nPos = columnIndex; 100 return m_aRow[m_nPos]; 101 } 102 ::com::sun::star::util::DateTime SAL_CALL OPrivateRow::getTimestamp( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 103 { 104 m_nPos = columnIndex; 105 return m_aRow[m_nPos]; 106 } 107 Reference< ::com::sun::star::io::XInputStream > SAL_CALL OPrivateRow::getBinaryStream( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 108 { 109 m_nPos = columnIndex; 110 return Reference< ::com::sun::star::io::XInputStream >(m_aRow[m_nPos].makeAny(),UNO_QUERY); 111 } 112 Reference< ::com::sun::star::io::XInputStream > SAL_CALL OPrivateRow::getCharacterStream( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 113 { 114 m_nPos = columnIndex; 115 return Reference< ::com::sun::star::io::XInputStream >(m_aRow[m_nPos].makeAny(),UNO_QUERY); 116 } 117 Any SAL_CALL OPrivateRow::getObject( ::sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& ) throw (SQLException, RuntimeException) 118 { 119 m_nPos = columnIndex; 120 return m_aRow[m_nPos].makeAny(); 121 } 122 Reference< XRef > SAL_CALL OPrivateRow::getRef( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 123 { 124 m_nPos = columnIndex; 125 return Reference< XRef >(m_aRow[m_nPos].makeAny(),UNO_QUERY); 126 } 127 Reference< XBlob > SAL_CALL OPrivateRow::getBlob( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 128 { 129 m_nPos = columnIndex; 130 return Reference< XBlob >(m_aRow[m_nPos].makeAny(),UNO_QUERY); 131 } 132 Reference< XClob > SAL_CALL OPrivateRow::getClob( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 133 { 134 m_nPos = columnIndex; 135 return Reference< XClob >(m_aRow[m_nPos].makeAny(),UNO_QUERY); 136 } 137 Reference< XArray > SAL_CALL OPrivateRow::getArray( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) 138 { 139 m_nPos = columnIndex; 140 return Reference< XArray >(m_aRow[m_nPos].makeAny(),UNO_QUERY); 141 } 142 143