Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker-TeeTime-Stages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeeTime
Kieker-TeeTime-Stages
Commits
c222991a
Commit
c222991a
authored
10 years ago
by
Nelson Tavares de Sousa
Browse files
Options
Downloads
Patches
Plain Diff
another bugs fixed
parent
510dc7ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/teetime/stage/io/DbReader.java
+8
-7
8 additions, 7 deletions
src/main/java/teetime/stage/io/DbReader.java
with
8 additions
and
7 deletions
src/main/java/teetime/stage/io/DbReader.java
+
8
−
7
View file @
c222991a
...
...
@@ -18,9 +18,9 @@ package teetime.stage.io;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
teetime.framework.ProducerStage
;
...
...
@@ -76,12 +76,13 @@ public class DbReader extends ProducerStage<IMonitoringRecord> {
Connection
connection
=
null
;
try
{
connection
=
DriverManager
.
getConnection
(
this
.
connectionString
);
Statement
getIndexTable
=
null
;
Prepared
Statement
getIndexTable
=
null
;
try
{
getIndexTable
=
connection
.
createStatement
();
getIndexTable
=
connection
.
prepareStatement
(
"SELECT * from $1"
,
new
String
[]
{
this
.
tablePrefix
});
;
// connection.createStatement();
ResultSet
indexTable
=
null
;
try
{
// NOCS (nested try)
indexTable
=
getIndexTable
.
executeQuery
(
"SELECT * from "
+
this
.
tablePrefix
);
indexTable
=
getIndexTable
.
executeQuery
();
while
(
this
.
running
&&
indexTable
.
next
())
{
final
String
tablename
=
indexTable
.
getString
(
1
);
final
String
classname
=
indexTable
.
getString
(
2
);
...
...
@@ -156,12 +157,12 @@ public class DbReader extends ProducerStage<IMonitoringRecord> {
*/
private
void
table2record
(
final
Connection
connection
,
final
String
tablename
,
final
Class
<?
extends
IMonitoringRecord
>
clazz
)
throws
SQLException
,
MonitoringRecordException
{
Statement
selectRecord
=
null
;
Prepared
Statement
selectRecord
=
null
;
try
{
selectRecord
=
connection
.
c
re
at
eStatement
();
selectRecord
=
connection
.
p
re
par
eStatement
(
"SELECT * from "
,
new
String
[]
{
tablename
}
);
ResultSet
records
=
null
;
try
{
records
=
selectRecord
.
executeQuery
(
"SELECT * from "
+
tablename
);
records
=
selectRecord
.
executeQuery
();
final
int
size
=
records
.
getMetaData
().
getColumnCount
()
-
2
;
// remove index column
while
(
this
.
running
&&
records
.
next
())
{
final
Object
[]
recordValues
=
new
Object
[
size
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment