#101824# correct propertInfo name access
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: DriverPropertyInfo.cxx,v $
|
||||
*
|
||||
* $Revision: 1.2 $
|
||||
* $Revision: 1.3 $
|
||||
*
|
||||
* last change: $Author: jl $ $Date: 2001-03-20 17:03:17 $
|
||||
* last change: $Author: oj $ $Date: 2002-08-01 07:15:14 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -130,7 +130,7 @@ java_sql_DriverPropertyInfo::operator starsdbc::DriverPropertyInfo()
|
||||
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if( t.pEnv )
|
||||
{
|
||||
jfieldID id = t.pEnv->GetFieldID(java_lang_Boolean::getMyClass(),"name","Ljava/lang/String;");
|
||||
jfieldID id = t.pEnv->GetFieldID(java_sql_DriverPropertyInfo::getMyClass(),"name","Ljava/lang/String;");
|
||||
if(id)
|
||||
aStr = JavaString2String(t.pEnv,(jstring)t.pEnv->GetObjectField( object, id));
|
||||
} //t.pEnv
|
||||
@@ -143,7 +143,7 @@ java_sql_DriverPropertyInfo::operator starsdbc::DriverPropertyInfo()
|
||||
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if( t.pEnv )
|
||||
{
|
||||
jfieldID id = t.pEnv->GetFieldID(java_lang_Boolean::getMyClass(),"description","Ljava/lang/String;");
|
||||
jfieldID id = t.pEnv->GetFieldID(java_sql_DriverPropertyInfo::getMyClass(),"description","Ljava/lang/String;");
|
||||
if(id)
|
||||
aStr = JavaString2String(t.pEnv,(jstring)t.pEnv->GetObjectField( object, id));
|
||||
} //t.pEnv
|
||||
@@ -156,7 +156,7 @@ java_sql_DriverPropertyInfo::operator starsdbc::DriverPropertyInfo()
|
||||
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if( t.pEnv )
|
||||
{
|
||||
jfieldID id = t.pEnv->GetFieldID(java_lang_Boolean::getMyClass(),"value","Ljava/lang/String;");
|
||||
jfieldID id = t.pEnv->GetFieldID(java_sql_DriverPropertyInfo::getMyClass(),"value","Ljava/lang/String;");
|
||||
if(id)
|
||||
aStr = JavaString2String(t.pEnv,(jstring)t.pEnv->GetObjectField( object, id));
|
||||
} //t.pEnv
|
||||
@@ -169,7 +169,7 @@ sal_Bool java_sql_DriverPropertyInfo::required() const
|
||||
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if( t.pEnv )
|
||||
{
|
||||
jfieldID id = t.pEnv->GetFieldID(java_lang_Boolean::getMyClass(),"required","B");
|
||||
jfieldID id = t.pEnv->GetFieldID(java_sql_DriverPropertyInfo::getMyClass(),"required","Z");
|
||||
if(id)
|
||||
out = t.pEnv->GetBooleanField( object, id);
|
||||
} //t.pEnv
|
||||
@@ -181,7 +181,7 @@ Sequence< ::rtl::OUString> java_sql_DriverPropertyInfo::choices() const
|
||||
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if( t.pEnv )
|
||||
{
|
||||
jfieldID id = t.pEnv->GetFieldID(java_lang_Boolean::getMyClass(),"choices","[Ljava/lang/String");
|
||||
jfieldID id = t.pEnv->GetFieldID(java_sql_DriverPropertyInfo::getMyClass(),"choices","[Ljava/lang/String;");
|
||||
if(id)
|
||||
return copyArrayAndDelete(t.pEnv,(jobjectArray)t.pEnv->GetObjectField( object, id), ::rtl::OUString(),java_lang_String(NULL,NULL));
|
||||
} //t.pEnv
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: JDriver.cxx,v $
|
||||
*
|
||||
* $Revision: 1.22 $
|
||||
* $Revision: 1.23 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2002-08-01 06:30:16 $
|
||||
* last change: $Author: oj $ $Date: 2002-08-01 07:15:15 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -173,17 +173,11 @@ void java_sql_Driver::saveClassRef( jclass pClass )
|
||||
// der uebergebe Klassen-Handle ist schon global, daher einfach speichern
|
||||
theClass = pClass;
|
||||
}
|
||||
// -------------------------------------------------------------------------
|
||||
Reference< XConnection > SAL_CALL java_sql_Driver::connect( const ::rtl::OUString& url, const
|
||||
Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
|
||||
// -----------------------------------------------------------------------------
|
||||
void java_sql_Driver::loadDriverFromProperties(const Sequence< PropertyValue >& info,::rtl::OUString& _rsGeneratedValueStatement,sal_Bool& _rbAutoRetrievingEnabled)
|
||||
{
|
||||
SDBThreadAttach t(getORB()); OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if(!t.pEnv)
|
||||
throw SQLException(::rtl::OUString::createFromAscii("No Java installed!"),*this,::rtl::OUString::createFromAscii("S1000"),1000 ,Any());
|
||||
Reference< XConnection > xRet;
|
||||
// first try if the jdbc driver is alraedy registered at the driver manager
|
||||
::rtl::OUString sGeneratedValueStatement; // contains the statement which should be used when query for automatically generated values
|
||||
sal_Bool bAutoRetrievingEnabled = sal_False; // set to when we should allow to query for generated values
|
||||
SDBThreadAttach t(getORB()); OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
try
|
||||
{
|
||||
if(!object)
|
||||
@@ -219,11 +213,11 @@ Reference< XConnection > SAL_CALL java_sql_Driver::connect( const ::rtl::OUStrin
|
||||
}
|
||||
else if(!pBegin->Name.compareToAscii("IsAutoRetrievingEnabled"))
|
||||
{
|
||||
pBegin->Value >>= bAutoRetrievingEnabled;
|
||||
pBegin->Value >>= _rbAutoRetrievingEnabled;
|
||||
}
|
||||
else if(!pBegin->Name.compareToAscii("AutoRetrievingStatement"))
|
||||
{
|
||||
pBegin->Value >>= sGeneratedValueStatement;
|
||||
pBegin->Value >>= _rsGeneratedValueStatement;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -246,7 +240,20 @@ Reference< XConnection > SAL_CALL java_sql_Driver::connect( const ::rtl::OUStrin
|
||||
}
|
||||
::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The specified driver could not be loaded!")) ,*this);
|
||||
}
|
||||
}
|
||||
// -------------------------------------------------------------------------
|
||||
Reference< XConnection > SAL_CALL java_sql_Driver::connect( const ::rtl::OUString& url, const
|
||||
Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
|
||||
{
|
||||
SDBThreadAttach t(getORB()); OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if(!t.pEnv)
|
||||
throw SQLException(::rtl::OUString::createFromAscii("No Java installed!"),*this,::rtl::OUString::createFromAscii("S1000"),1000 ,Any());
|
||||
Reference< XConnection > xRet;
|
||||
|
||||
|
||||
::rtl::OUString sGeneratedValueStatement; // contains the statement which should be used when query for automatically generated values
|
||||
sal_Bool bAutoRetrievingEnabled = sal_False; // set to when we should allow to query for generated values
|
||||
loadDriverFromProperties(info,sGeneratedValueStatement,bAutoRetrievingEnabled);
|
||||
jobject out(0);
|
||||
|
||||
if( t.pEnv )
|
||||
@@ -321,8 +328,14 @@ Sequence< DriverPropertyInfo > SAL_CALL java_sql_Driver::getPropertyInfo( const
|
||||
::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid URL!")) ,*this);
|
||||
|
||||
SDBThreadAttach t(getORB()); OSL_ENSURE(t.pEnv,"Java Enviroment gel<65>scht worden!");
|
||||
if(!object)
|
||||
object = java_sql_DriverManager::getDriver(url);
|
||||
|
||||
if ( !object )
|
||||
{
|
||||
// driver was not loaded so far, load it by name
|
||||
::rtl::OUString sGeneratedValueStatement; // contains the statement which should be used when query for automatically generated values
|
||||
sal_Bool bAutoRetrievingEnabled = sal_False; // set to when we should allow to query for generated values
|
||||
loadDriverFromProperties(info,sGeneratedValueStatement,bAutoRetrievingEnabled);
|
||||
}
|
||||
|
||||
if(!object)
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: tools.cxx,v $
|
||||
*
|
||||
* $Revision: 1.9 $
|
||||
* $Revision: 1.10 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2002-05-10 11:37:53 $
|
||||
* last change: $Author: oj $ $Date: 2002-08-01 07:15:16 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -184,6 +184,9 @@ java_util_Properties* connectivity::createStringPropertyArray(JNIEnv *pEnv,const
|
||||
if( pBegin->Name.compareToAscii("JavaDriverClass") &&
|
||||
pBegin->Name.compareToAscii("CharSet") &&
|
||||
pBegin->Name.compareToAscii("ParameterNameSubstitution") &&
|
||||
pBegin->Name.compareToAscii("IsPasswordRequired") &&
|
||||
pBegin->Name.compareToAscii("IsAutoRetrievingEnabled") &&
|
||||
pBegin->Name.compareToAscii("AutoRetrievingStatement") &&
|
||||
pBegin->Name.compareToAscii("BooleanComparisonMode"))
|
||||
{
|
||||
::rtl::OUString aStr;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: Object.hxx,v $
|
||||
*
|
||||
* $Revision: 1.3 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2000-12-12 13:34:23 $
|
||||
* last change: $Author: oj $ $Date: 2002-08-01 07:16:23 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -140,8 +140,6 @@ namespace connectivity
|
||||
static jclass theJSbxObjectClass; // die Klasse braucht nur einmal angefordert werden !
|
||||
static sal_uInt32 nObjCount; // Zaehler fuer die Anzahl der Instanzen
|
||||
|
||||
static void ThrowSQLException(JNIEnv * pEnv,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> & _rContext) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
|
||||
|
||||
public:
|
||||
// der Konstruktor, der fuer die abgeleiteten Klassen verwendet
|
||||
// werden soll.
|
||||
@@ -159,6 +157,7 @@ namespace connectivity
|
||||
|
||||
::rtl::OUString toString();
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xFactory; }
|
||||
static void ThrowSQLException(JNIEnv * pEnv,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> & _rContext) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
|
||||
};
|
||||
}
|
||||
#endif //_CONNECTIVITY_JAVA_LANG_OBJJECT_HXX_
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: Driver.hxx,v $
|
||||
*
|
||||
* $Revision: 1.3 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2002-07-25 07:19:58 $
|
||||
* last change: $Author: oj $ $Date: 2002-08-01 07:16:25 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -90,6 +90,9 @@ namespace connectivity
|
||||
static jclass theClass;
|
||||
// der Destruktor um den Object-Counter zu aktualisieren
|
||||
static void saveClassRef( jclass pClass );
|
||||
|
||||
void loadDriverFromProperties( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info,::rtl::OUString& _rsGeneratedValueStatement,sal_Bool& _rbAutoRetrievingEnabled);
|
||||
|
||||
virtual ~java_sql_Driver();
|
||||
public:
|
||||
// only available to set the driver
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
*
|
||||
* $RCSfile: tools.hxx,v $
|
||||
*
|
||||
* $Revision: 1.3 $
|
||||
* $Revision: 1.4 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2001-05-09 12:59:06 $
|
||||
* last change: $Author: oj $ $Date: 2002-08-01 07:16:22 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
@@ -111,6 +111,7 @@ namespace connectivity
|
||||
for(jsize i=0;i<nLen;++i)
|
||||
{
|
||||
JT xInfo(pEnv,pEnv->GetObjectArrayElement(_Array,i));
|
||||
java_lang_Object::ThrowSQLException(pEnv,NULL);
|
||||
xOut.getArray()[i] = xInfo;
|
||||
}
|
||||
pEnv->DeleteLocalRef(_Array);
|
||||
|
||||
Reference in New Issue
Block a user