Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1d7ad324
Kaydet (Commit)
1d7ad324
authored
Haz 04, 2013
tarafından
Javier Fernandez
Kaydeden (comit)
Andrzej J.R. Hunt
Tem 16, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Executing again a PreparedStatement.
Change-Id: I10afa596ed0464e14c4fd95d3a7fb687451a10b4
üst
fd327189
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
32 deletions
+44
-32
FDatabaseMetaData.cxx
connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
+7
-3
FDatabaseMetaData.hxx
connectivity/source/drivers/firebird/FDatabaseMetaData.hxx
+1
-0
FPreparedStatement.cxx
connectivity/source/drivers/firebird/FPreparedStatement.cxx
+9
-10
FResultSet.cxx
connectivity/source/drivers/firebird/FResultSet.cxx
+2
-2
FStatement.cxx
connectivity/source/drivers/firebird/FStatement.cxx
+25
-17
No files found.
connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
Dosyayı görüntüle @
1d7ad324
...
...
@@ -61,6 +61,7 @@ namespace connectivity
ODatabaseMetaData
::
ODatabaseMetaData
(
OConnection
*
_pCon
)
:
m_pConnection
(
_pCon
)
,
m_pGetTablesStm
(
NULL
)
,
m_bUseCatalog
(
sal_True
)
{
OSL_ENSURE
(
m_pConnection
,
"ODatabaseMetaData::ODatabaseMetaData: No connection set!"
);
...
...
@@ -865,25 +866,28 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
ODatabaseMetaDataResultSet
*
pResultSet
=
new
ODatabaseMetaDataResultSet
(
ODatabaseMetaDataResultSet
::
eTables
);
Reference
<
XResultSet
>
xResultSet
=
pResultSet
;
Reference
<
XPreparedStatement
>
statement
=
m_pConnection
->
prepareStatement
(
if
(
!
m_pGetTablesStm
.
is
())
{
m_pGetTablesStm
=
m_pConnection
->
prepareStatement
(
"SELECT "
"'schema' as schema, RDB$RELATION_NAME, RDB$SYSTEM_FLAG, RDB$RELATION_TYPE, 'description' as description "
// avoid duplicates
"FROM RDB$RELATIONS "
"WHERE (RDB$RELATION_TYPE = 0 OR RDB$RELATION_TYPE = 1) "
"AND 'schema' LIKE ? "
"AND RDB$RELATION_NAME LIKE ? "
);
}
SAL_INFO
(
"connectivity.firebird"
,
"=> ODatabaseMetaData::getTables(). "
"Setting query parameters."
);
Reference
<
XParameters
>
parameters
(
statement
,
UNO_QUERY_THROW
);
Reference
<
XParameters
>
parameters
(
m_pGetTablesStm
,
UNO_QUERY_THROW
);
parameters
->
setString
(
1
,
schemaPattern
);
parameters
->
setString
(
2
,
tableNamePattern
);
SAL_INFO
(
"connectivity.firebird"
,
"=> ODatabaseMetaData::getTables(). "
"About to execute the query."
);
Reference
<
XResultSet
>
rs
=
statement
->
executeQuery
();
Reference
<
XResultSet
>
rs
=
m_pGetTablesStm
->
executeQuery
();
Reference
<
XRow
>
xRow
(
rs
,
UNO_QUERY_THROW
);
ODatabaseMetaDataResultSet
::
ORows
aRows
;
int
rows
=
0
;
...
...
connectivity/source/drivers/firebird/FDatabaseMetaData.hxx
Dosyayı görüntüle @
1d7ad324
...
...
@@ -53,6 +53,7 @@ namespace connectivity
class
ODatabaseMetaData
:
public
ODatabaseMetaData_BASE
{
OConnection
*
m_pConnection
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
sdbc
::
XPreparedStatement
>
m_pGetTablesStm
;
sal_Bool
m_bUseCatalog
;
public
:
...
...
connectivity/source/drivers/firebird/FPreparedStatement.cxx
Dosyayı görüntüle @
1d7ad324
...
...
@@ -354,25 +354,24 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE
checkDisposed
(
OStatement_BASE
::
rBHelper
.
bDisposed
);
ISC_STATUS_ARRAY
status
;
/* status vector */
if
(
NULL
!=
m_INsqlda
)
if
(
0
==
m_TRANSHandler
)
{
if
(
isc_dsql_execute2
(
status
,
&
m_TRANSHandler
,
&
m_STMTHandler
,
1
,
m_INsqlda
,
NULL
))
if
(
pr_error
(
status
,
"execute2 query"
))
return
NULL
;
}
else
{
if
(
isc_dsql_execute
(
status
,
&
m_TRANSHandler
,
&
m_STMTHandler
,
1
,
NULL
))
if
(
pr_error
(
status
,
"execute query"
))
isc_db_handle
db
=
m_pConnection
->
getDBHandler
();
// database handle
if
(
isc_start_transaction
(
status
,
&
m_TRANSHandler
,
1
,
&
db
,
0
,
NULL
))
if
(
pr_error
(
status
,
"start transaction"
))
return
NULL
;
}
if
(
isc_dsql_execute
(
status
,
&
m_TRANSHandler
,
&
m_STMTHandler
,
1
,
m_INsqlda
))
if
(
pr_error
(
status
,
"execute query"
))
return
NULL
;
Reference
<
OResultSet
>
pResult
(
new
OResultSet
(
this
)
);
//initializeResultSet( pResult.get() );
Reference
<
XResultSet
>
xRS
=
pResult
.
get
();
if
(
isc_commit_transaction
(
status
,
&
m_TRANSHandler
))
if
(
pr_error
(
status
,
"
star
t transaction"
))
if
(
pr_error
(
status
,
"
commi
t transaction"
))
return
NULL
;
SAL_INFO
(
"connectivity.firebird"
,
"=> OPreparedStatement::executeQuery(). "
...
...
connectivity/source/drivers/firebird/FResultSet.cxx
Dosyayı görüntüle @
1d7ad324
...
...
@@ -143,8 +143,8 @@ OResultSet::OResultSet(OStatement_Base* pStmt)
if
(
pr_error
(
status
,
"fetch data"
))
return
;
}
if
(
isc_dsql_free_statement
(
status
,
&
stmt
,
DSQL_
drop
))
if
(
pr_error
(
status
,
"f
etch data
"
))
if
(
isc_dsql_free_statement
(
status
,
&
stmt
,
DSQL_
close
))
if
(
pr_error
(
status
,
"f
ree statement
"
))
return
;
}
// -------------------------------------------------------------------------
...
...
connectivity/source/drivers/firebird/FStatement.cxx
Dosyayı görüntüle @
1d7ad324
...
...
@@ -58,6 +58,26 @@ using namespace com::sun::star::sdbcx;
using
namespace
com
::
sun
::
star
::
container
;
using
namespace
com
::
sun
::
star
::
io
;
using
namespace
com
::
sun
::
star
::
util
;
//------------------------------------------------------------------------------
/*
* Print the status, the SQLCODE, and exit.
* Also, indicate which operation the error occured on.
*/
static
int
pr_error
(
long
*
status
,
char
*
operation
)
{
printf
(
"[
\n
"
);
printf
(
"PROBLEM ON
\"
%s
\"
.
\n
"
,
operation
);
isc_print_status
(
status
);
printf
(
"SQLCODE:%d
\n
"
,
isc_sqlcode
(
status
));
printf
(
"]
\n
"
);
return
1
;
}
//------------------------------------------------------------------------------
OStatement_Base
::
OStatement_Base
(
OConnection
*
_pConnection
)
:
OStatement_BASE
(
m_aMutex
),
...
...
@@ -108,6 +128,11 @@ void OStatement_BASE2::disposing()
free
(
m_INsqlda
);
}
ISC_STATUS_ARRAY
status
;
// status vector
if
(
isc_dsql_free_statement
(
status
,
&
m_STMTHandler
,
DSQL_drop
))
if
(
pr_error
(
status
,
"fetch data"
))
return
;
dispose_ChildImpl
();
OStatement_Base
::
disposing
();
}
...
...
@@ -172,23 +197,6 @@ sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(S
}
// -------------------------------------------------------------------------
/*
* Print the status, the SQLCODE, and exit.
* Also, indicate which operation the error occured on.
*/
static
int
pr_error
(
long
*
status
,
char
*
operation
)
{
SAL_WARN
(
"connectivity.firebird"
,
"=> OStatement_Base static pr_error()."
);
isc_print_status
(
status
);
SAL_WARN
(
"connectivity.firebird"
,
"=> OStatement_Base static pr_error(). "
"PROBLEM ON "
<<
operation
<<
". "
"SQLCODE: "
<<
isc_sqlcode
(
status
)
<<
"."
);
return
1
;
}
Reference
<
XResultSet
>
SAL_CALL
OStatement_Base
::
executeQuery
(
const
::
rtl
::
OUString
&
sql
)
throw
(
SQLException
,
RuntimeException
)
{
SAL_INFO
(
"connectivity.firebird"
,
"=> OStatement_Base::executeQuery(). "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment