Skip to content

Commit

Permalink
SQL console
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/jailer/code/trunk@1410 3dd849cd-670e-4645-a7cd-dd197c8d0e81
  • Loading branch information
rwisser committed Oct 11, 2017
1 parent ce055dd commit 5fbad32
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,6 @@
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Result"/>
</Border>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,13 @@ private void executeSQL(final String sql, Status status, int statementStartOffse
final CachedResultSet metaDataDetails = new CachedResultSet(resultSet, limit, session, SQLConsole.this);
resultSet.close();
long now = System.currentTimeMillis();
status.hasSelected = true;
status.timeInMS += (now - startTime);
localStatus.timeInMS += (now - startTime);
status.numRowsRead += metaDataDetails.getSize();
localStatus.numRowsRead += metaDataDetails.getSize();
if (metaDataDetails.getSize() >= limit) {
localStatus.hasSelected = true;
if (metaDataDetails.getSize() >= limit) {
status.limitExceeded = true;
localStatus.limitExceeded = true;
}
Expand Down Expand Up @@ -467,6 +469,7 @@ public void actionPerformed(ActionEvent e) {
int updateCount = statement.getUpdateCount();
status.numRowsUpdated += updateCount;
status.updateView(false);
status.hasUpdated = true;
if (updateCount != 0) {
setDataHasChanged(true);
}
Expand Down Expand Up @@ -553,6 +556,8 @@ private class Status {
int numRowsRead;
int numRowsUpdated;
int numStatements;
boolean hasSelected = false;
boolean hasUpdated = false;
long timeInMS;
Throwable error;
Pair<Integer, Integer> location;
Expand Down Expand Up @@ -656,14 +661,14 @@ private String getText() {
if (numStatements > 1) {
text += numStatements + " Statements. ";
}
if (numRowsRead > 0 || numRowsUpdated == 0) {
if (hasSelected) {
text += numRowsRead + " rows read";
if (limitExceeded) {
text += " (limit exceeded)";
}
text += ". ";
}
if (numRowsUpdated > 0 || numRowsRead == 0) {
if (hasUpdated) {
text += numRowsUpdated + " rows updated. ";
}
return text + "Elapsed time: " + (timeInMS / 1000.0) + " sec";
Expand Down Expand Up @@ -834,7 +839,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

jSplitPane1.setLeftComponent(jSplitPane2);

jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Result"));
jPanel3.setLayout(new java.awt.BorderLayout());
jPanel3.add(jTabbedPane1, java.awt.BorderLayout.CENTER);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
<GridBagConstraints gridX="2" gridY="2" gridWidth="1" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private void initComponents() {

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridheight = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
add(panel, gridBagConstraints);
}// </editor-fold>//GEN-END:initComponents
Expand Down

0 comments on commit 5fbad32

Please sign in to comment.