Bump for 3.6-28
[LibreOffice.git] / connectivity / source / drivers / jdbc / JBigDecimal.cxx
blob7c450107b5a99ba7343b39239fa16bedc5a7605a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "java/math/BigDecimal.hxx"
30 #include "java/tools.hxx"
31 #include "resource/jdbc_log.hrc"
32 using namespace connectivity;
33 //**************************************************************
34 //************ Class: java.lang.Boolean
35 //**************************************************************
37 jclass java_math_BigDecimal::theClass = 0;
39 java_math_BigDecimal::~java_math_BigDecimal()
42 jclass java_math_BigDecimal::getMyClass() const
44 // the class must be fetched only once, therefore static
45 if( !theClass )
46 theClass = findMyClass("java/math/BigDecimal");
47 return theClass;
50 java_math_BigDecimal::java_math_BigDecimal( const ::rtl::OUString& _par0 ): java_lang_Object( NULL, (jobject)NULL )
52 SDBThreadAttach t;
53 if( !t.pEnv )
54 return;
55 // Java-Call for the Constructor
56 // initialize temporary Variable
57 static const char * cSignature = "(Ljava/lang/String;)V";
58 jobject tempObj;
59 static jmethodID mID(NULL);
60 obtainMethodId(t.pEnv, "<init>",cSignature, mID);
62 jstring str = convertwchar_tToJavaString(t.pEnv,_par0.replace(',','.'));
63 tempObj = t.pEnv->NewObject( getMyClass(), mID, str );
64 t.pEnv->DeleteLocalRef(str);
65 saveRef( t.pEnv, tempObj );
66 t.pEnv->DeleteLocalRef( tempObj );
67 ThrowSQLException( t.pEnv, NULL );
68 // and cleanup
71 java_math_BigDecimal::java_math_BigDecimal( const double& _par0 ): java_lang_Object( NULL, (jobject)NULL )
73 SDBThreadAttach t;
74 if( !t.pEnv )
75 return;
76 // Java-Call for the Constructor
77 // initialize temporary Variable
78 static const char * cSignature = "(D)V";
79 jobject tempObj;
80 static jmethodID mID(NULL);
81 obtainMethodId(t.pEnv, "<init>",cSignature, mID);
82 tempObj = t.pEnv->NewObject( getMyClass(), mID, _par0 );
83 saveRef( t.pEnv, tempObj );
84 t.pEnv->DeleteLocalRef( tempObj );
85 ThrowSQLException( t.pEnv, NULL );
86 // and cleanup
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */