1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SQLException.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_connectivity.hxx"
33 #include "java/sql/SQLException.hxx"
34 #include "java/tools.hxx"
36 using namespace connectivity
;
37 using namespace ::com::sun::star::uno
;
38 using namespace ::com::sun::star::beans
;
39 // using namespace ::com::sun::star::sdbcx;
40 using namespace ::com::sun::star::sdbc
;
41 using namespace ::com::sun::star::container
;
42 using namespace ::com::sun::star::lang
;
43 //**************************************************************
44 //************ Class: java.sql.SQLException
45 //**************************************************************
46 java_sql_SQLException::java_sql_SQLException( const java_sql_SQLException_BASE
& _rException
,const Reference
< XInterface
> & _rContext
)
47 : starsdbc::SQLException( _rException
.getMessage(),
49 _rException
.getSQLState(),
50 _rException
.getErrorCode(),
51 makeAny(_rException
.getNextException())
56 java_sql_SQLException_BASE::java_sql_SQLException_BASE( JNIEnv
* pEnv
, jobject myObj
) : java_lang_Exception( pEnv
, myObj
)
60 jclass
java_sql_SQLException_BASE::theClass
= 0;
62 java_sql_SQLException_BASE::~java_sql_SQLException_BASE()
66 jclass
java_sql_SQLException_BASE::getMyClass() const
68 return st_getMyClass();
70 jclass
java_sql_SQLException_BASE::st_getMyClass()
72 // die Klasse muss nur einmal geholt werden, daher statisch
74 theClass
= findMyClass("java/sql/SQLException");
78 starsdbc::SQLException
java_sql_SQLException_BASE::getNextException() const
81 static jmethodID
mID(NULL
);
82 jobject out
= callObjectMethod(t
.pEnv
,"getNextException","()Ljava/sql/SQLException;", mID
);
83 // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!!
86 java_sql_SQLException_BASE
warn_base(t
.pEnv
,out
);
87 return (starsdbc::SQLException
)java_sql_SQLException(warn_base
,0);
90 return starsdbc::SQLException();
93 ::rtl::OUString
java_sql_SQLException_BASE::getSQLState() const
95 static jmethodID
mID(NULL
);
96 return callStringMethod("getSQLState",mID
);
98 sal_Int32
java_sql_SQLException_BASE::getErrorCode() const
100 static jmethodID
mID(NULL
);
101 return callIntMethod("getErrorCode",mID
);