[ANN] SQLQueryPlugin version 1.3.0 released

I've just uploaded the newest release of my JDBC/SQL plugin.

http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin

Changes

  • Changed structure of data in workspace

  • Fixed bug: Opening dialogs outside of event thread

  • Added database groups

  • Moved database browser into separate tool window

  • Save queries into workspace

  • Copy query parts from browser window to query window

  • Show update statements in message tab if editing a result table

  • Confirmation dialogs for 'Commit', 'Rollback' and 'Close all connections'



Bye,
Stefan.

26 comments

Love it, love it, love it! Thank you! :D

One minor problem with the SQL Schema tool window: it doesn't seem to always remember its state. Steps to reproduce:

1) In the SQL tool window (which I have set to pinned, floating mode), click on the Show Database Structure button.

2) The SQL Schema tool window appears.

3) Change the SQL Schema tool window to pinned, floating mode.

4) Close the SQL Schema tool window by clicking on the red X button.

5) Re-open the SQL Schema tool window by clicking on the Show Database Structure button in the SQL tool window.

6) The SQL Schema tool window appears in docked mode. It should appear in floating mode (in the same location as it was when closed in step 4).

thanks for a GREAT plugin!

chris

0

I can't seem to execute queries with this version (or any version newer than 1.2.0). I always get this error in the console:

(Unknown Source) at com.kiwisoft.sqlPlugin.QueryPanel.executeSelect(Unknown Source) at com.kiwisoft.sqlPlugin.QueryPanel.access$1800(Unknown Source) at com.kiwisoft.sqlPlugin.QueryPanel$ExecutionThread.run(Unknown Source) ]]>

I'm using Aurora 963 on Win2k hitting a DB2 database. DB2 version is 7.1 fixpack 8.

0

Correction: SELECT queries work unless I use the *. For example, this works:


but this doesn't:

0

It works fine for me on DB2 v8.1.2.169 (Build level s030508) on WinXP.

One thing I'm having problems with, though, is the database structure part.
I'm getting an exception (COM.ibm.db2.jdbc.DB2Exception: [CLI
Driver][DB2/NT] SQL0954C Not enough storage is available in the application
heap to process the statement. SQLSTATE=57011) every time I try to expand a
schema node.

The reason I think this might have something to do with this plugin as well
is that the SQLViewer plugin (the other SQL plugin) shows the schema without
problems.

As a matter of fact, one thing I noticed some time ago (and one of the
reasons I kept the other plugin around) is that the schema browsing is way
slower in this plugin than in the other one (on a big Oracle database I was
using for another project this plugin spent as much as 20 seconds every time
I opened the structure view, while the SQLViewer didn't experience any
delays when bringing up the schemas). Probably because of the attempt to
build the whole graph at once?

Anyway, the plugin is great (despite the occasional problems) and I'm really
thankfull for being able to use it.

Andrei


"Chris Bartley" <no_mail@jetbrains.com> wrote in message
news:29891884.1068740336799.JavaMail.itn@is.intellij.net...

Correction: SELECT queries work unless I use the *. For example, this

works:
>

>

but this doesn't:

>



0

It works fine for me on DB2 v8.1.2.169 (Build level s030508) on WinXP.

One thing I'm having problems with, though, is the database structure part.
I'm getting an exception (COM.ibm.db2.jdbc.DB2Exception: [CLI
Driver][DB2/NT] SQL0954C Not enough storage is available in the application
heap to process the statement. SQLSTATE=57011) every time I try to expand a
schema node.

The reason I think this might have something to do with this plugin as well
is that the SQLViewer plugin (the other SQL plugin) shows the schema without
problems.

As a matter of fact, one thing I noticed some time ago (and one of the
reasons I kept the other plugin around) is that the schema browsing is way
slower in this plugin than in the other one (on a big Oracle database I was
using for another project this plugin spent as much as 20 seconds every time
I opened the structure view, while the SQLViewer didn't experience any
delays when bringing up the schemas). Probably because of the attempt to
build the whole graph at once?

Anyway, the plugin is great (despite the occasional problems) and I'm really
thankfull for being able to use it.

Andrei


"Chris Bartley" <no_mail@jetbrains.com> wrote in message
news:29891884.1068740336799.JavaMail.itn@is.intellij.net...

Correction: SELECT queries work unless I use the *. For example, this

works:
>

>

but this doesn't:

>



0

I've attached the re-compiled plugin with debug information. It would help to fix the bug if you reproduce the exception with
line numbers.

Thanks, Stefan

Chris Bartley wrote:

I can't seem to execute queries with this version (or any version newer than 1.2.0). I always get this error in the console:

at com.kiwisoft.sqlPlugin.ResultSetTableModel.createData(Unknown Source) > at com.kiwisoft.sqlPlugin.ResultSetTableModel.(Unknown Source) > at com.kiwisoft.sqlPlugin.QueryPanel.executeSelect(Unknown Source) > at com.kiwisoft.sqlPlugin.QueryPanel.access$1800(Unknown Source) > at com.kiwisoft.sqlPlugin.QueryPanel$ExecutionThread.run(Unknown Source) > ]]>

I'm using Aurora 963 on Win2k hitting a DB2 database. DB2 version is 7.1 fixpack 8.




Attachment(s):
ks-sql.jar
0

Here ya go:

(ResultSetTableModel.java:78) at com.kiwisoft.sqlPlugin.QueryPanel.executeSelect(QueryPanel.java:557) at com.kiwisoft.sqlPlugin.QueryPanel.access$1800(QueryPanel.java:79) at com.kiwisoft.sqlPlugin.QueryPanel$ExecutionThread.run(QueryPanel.java:655) ]]>

Thanks!

0

Hi,
first off thanks for the great plugin. I am using it more and more.

second,
what is the functionality of this in the new release?

  • Added database groups


I just declare some connections setup as part of "development group" or "production group" but don't see what else this could be used for ?


A feature request that seems missing:
- It would be nice to be able to view the stored procedure database objects, edit and then recommit.


A bug with Informix while trying to create a stored procedure:
- running this simple stored prcoedure creation script in the query window results in "A syntax error has occured" in the result window whereas it works using dbaccess tool provided by informix:

CREATE PROCEDURE get_cancel_test (message_id INTEGER)
returning
CHAR(1);
DEFINE ocounter_id CHAR(1);
select
o_counter_id
into
ocounter_id
from
cancel_message
where
o_message_id = message_id;
return ocounter_id;
END PROCEDURE;




thanks again.
j.

0

I've attached the plugin with a bugfix. Please let me know if it is working.

Thanks, Stefan.


Chris Bartley wrote:

Here ya go:

at com.kiwisoft.sqlPlugin.ResultSetTableModel.createData(ResultSetTableModel.java:160) > at com.kiwisoft.sqlPlugin.ResultSetTableModel.(ResultSetTableModel.java:78) > at com.kiwisoft.sqlPlugin.QueryPanel.executeSelect(QueryPanel.java:557) > at com.kiwisoft.sqlPlugin.QueryPanel.access$1800(QueryPanel.java:79) > at com.kiwisoft.sqlPlugin.QueryPanel$ExecutionThread.run(QueryPanel.java:655) > ]]>

Thanks!




Attachment(s):
ks-sql.jar
0

Thanks for your help. I still get an NPE, but the stack trace is different now:

(ResultSetTableModel.java:65) at com.kiwisoft.sqlPlugin.QueryPanel.executeSelect(QueryPanel.java:557) at com.kiwisoft.sqlPlugin.QueryPanel.access$1800(QueryPanel.java:79) at com.kiwisoft.sqlPlugin.QueryPanel$ExecutionThread.run(QueryPanel.java:655) ]]>

0

It seems for me like the driver returns a primitive class as a column class name.
I've attached a new version there I try to consider all such cases.

Thanks, Stefan.

Chris Bartley wrote:

Thanks for your help. I still get an NPE, but the stack trace is different now:

at com.kiwisoft.utils.ObjectUtils.getBaseClass(ObjectUtils.java:33) > at com.kiwisoft.sqlPlugin.ResultSetTableModel.createData(ResultSetTableModel.java:144) > at com.kiwisoft.sqlPlugin.ResultSetTableModel.(ResultSetTableModel.java:65) > at com.kiwisoft.sqlPlugin.QueryPanel.executeSelect(QueryPanel.java:557) > at com.kiwisoft.sqlPlugin.QueryPanel.access$1800(QueryPanel.java:79) > at com.kiwisoft.sqlPlugin.QueryPanel$ExecutionThread.run(QueryPanel.java:655) > ]]>




Attachment(s):
ks-sql.jar
0

What do you think of visualizing the auto-commit-property of a database configuration using clear icons on the main window, maybe in between the database- and the group-combo?
This could be red and green traffic lights to clearly show the immediate consequences of insert/update-statements.

0

It's a good suggestion, but I would move it into the status bar.

Frank Bruch wrote:

What do you think of visualizing the auto-commit-property of a database configuration using clear icons on the main window, maybe in between the database- and the group-combo?
This could be red and green traffic lights to clearly show the immediate consequences of insert/update-statements.


0

That's fine. Maybe colored text would work fine.

No auto commit (grey or black)
Auto commit (red)

0

what is the functionality of this in the new release?

  • Added database groups


I just declare some connections setup as part of "development group" or "production group" but don't see what else this could be used for ?


This is all I wanted from this functionality. I have many databases in my configuration and wanted a tool to group them by certain criteria.

A feature request that seems missing:
- It would be nice to be able to view the stored procedure database objects, edit and then recommit.


This is nearly impossible for me because the databases have no unique way to retrieve the procedures, functions and so on.

> A bug with Informix while trying to create a stored procedure:
> - running this simple stored prcoedure creation script in the query window results in "A syntax error has occured" in the result window whereas it works using dbaccess tool provided by informix:

I know of this problem but there were always other features which I wanted to implement first.
Maybe I will fix it in the near future.


Thanks, Stefan.

0

Additionally the commit- and abort-buttons may be disabled if auto-commit is not active.

And the auto-commit-status-display may have a context-menu to toggle the state and react on double-click.

That would mean consistent behaviour with "Import Popup: ON".

Maybe "Auto Commit: ON", ""Auto Commit: OFF" would be fine than. Colored, if ON.

0

It looks like the "Copy to clipboard"-operation on result set table cells always copies the default format regardless of the chosen format.

0

Thanks for the hint. I will fix it.

Frank Bruch wrote:

It looks like the "Copy to clipboard"-operation on result set table cells always copies the default format regardless of the chosen format.


0

First of all, thanks for the very useful plugin.

There are a couple of small feature requests though:

1. An ability to use a fixed width font. I recall that first versions were using the same
font as the editor. Can I have it back, or better have it configurable, or better yet have it
configurable for every column? I'm using bit-group encodings to store highly
complex data graphs so it really helps when I can visually compare long hex numbers
in a column.

2. Related to the first. Is it possible to remember format settings at least for the duration of
the session? It is really annoying to change 10 column to hex representation after each
query.

It's OK if you don't keep font/format/alignment settings between IDEA sessions so it should be
relatively easy to implement. Group (i.e. multiple columns at once) settings can also help.

Thanks again, Oleg

"Stefan Stiller" <stefan.stiller@net-linx.de> wrote in message news:3FB37856.2020209@net-linx.de...

I've just uploaded the newest release of my JDBC/SQL plugin.

>

http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin

>

Changes

  • Changed structure of data in workspace

  • Fixed bug: Opening dialogs outside of event thread

  • Added database groups

  • Moved database browser into separate tool window

  • Save queries into workspace

  • Copy query parts from browser window to query window

  • Show update statements in message tab if editing a result table

  • Confirmation dialogs for 'Commit', 'Rollback' and 'Close all connections'

>
>

Bye,
Stefan.

>


0

Looks like a bug:

A long value 584341862672771330 shows up as h81bffd400002900
while it must be h81bffd400002902. Strange...

--Oleg

"Stefan Stiller" <stefan.stiller@net-linx.de> wrote in message news:3FB37856.2020209@net-linx.de...

I've just uploaded the newest release of my JDBC/SQL plugin.

>

http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin

>

Changes

  • Changed structure of data in workspace

  • Fixed bug: Opening dialogs outside of event thread

  • Added database groups

  • Moved database browser into separate tool window

  • Save queries into workspace

  • Copy query parts from browser window to query window

  • Show update statements in message tab if editing a result table

  • Confirmation dialogs for 'Commit', 'Rollback' and 'Close all connections'

>
>

Bye,
Stefan.

>


0

1. An ability to use a fixed width font. I recall that first versions were using the same
font as the editor. Can I have it back, or better have it configurable, or better yet have it
configurable for every column? I'm using bit-group encodings to store highly
complex data graphs so it really helps when I can visually compare long hex numbers
in a column.


I should be relatively easy to make the font for a column configurable. I will try to implement it in one of the
next versions.

2. Related to the first. Is it possible to remember format settings at least for the duration of
the session? It is really annoying to change 10 column to hex representation after each
query.


I could remember the format settings as long as it is the same query. If you modify the query I can't
determine if the column is the same as in the old query.

Thanks, Stefan.

0

It's a bug in my number format. I will fix it.

Thanks, Stefan.

Oleg Danilov wrote:

Looks like a bug:

A long value 584341862672771330 shows up as h81bffd400002900
while it must be h81bffd400002902. Strange...

--Oleg

"Stefan Stiller" <stefan.stiller@net-linx.de> wrote in message news:3FB37856.2020209@net-linx.de...

>>I've just uploaded the newest release of my JDBC/SQL plugin.
>>
>>http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin
>>
>>Changes
>> * Changed structure of data in workspace
>> * Fixed bug: Opening dialogs outside of event thread
>> * Added database groups
>> * Moved database browser into separate tool window
>> * Save queries into workspace
>> * Copy query parts from browser window to query window
>> * Show update statements in message tab if editing a result table
>> * Confirmation dialogs for 'Commit', 'Rollback' and 'Close all connections'
>>
>>
>>Bye,
>>Stefan.
>>



0


"Stefan Stiller" <stefan.stiller@net-linx.de> wrote in message news:3FBC83CC.3040806@net-linx.de...

1. An ability to use a fixed width font. I recall that first versions were using the same
font as the editor. Can I have it back, or better have it configurable, or better yet have it
configurable for every column? I'm using bit-group encodings to store highly
complex data graphs so it really helps when I can visually compare long hex numbers
in a column.

>

I should be relatively easy to make the font for a column configurable. I will try to implement it in one of the
next versions.


Excellent! Thanks!

>

2. Related to the first. Is it possible to remember format settings at least for the duration of
the session? It is really annoying to change 10 column to hex representation after each
query.

>

I could remember the format settings as long as it is the same query. If you modify the query I can't
determine if the column is the same as in the old query.


It's more than enough for me (especially if you can save this settings along with the query
as a special comment or in another file).

I'd also like to add my vote to Barry Kaplan's request about custom column formatters.
Perhaps we can just associate some names with static methods of some classes
like "Reference" -> "my.package.Formatters:formatReference" or so. Such a method could
take one Object argument and return a string, for example.
These names would appear in right-click list of formats available so by choosing format
"Reference" I can display long number 655273556803848831 as much more readable
"O.TypeSymptom:A" rather than just "h917FFD400000A7F".
It would make the plugin a really unique tool indeed.

Thanks, Oleg



0


Oleg Danilov wrote:

I'd also like to add my vote to Barry Kaplan's request about custom column formatters.
Perhaps we can just associate some names with static methods of some classes
like "Reference" -> "my.package.Formatters:formatReference" or so. Such a method could
take one Object argument and return a string, for example.
These names would appear in right-click list of formats available so by choosing format
"Reference" I can display long number 655273556803848831 as much more readable
"O.TypeSymptom:A" rather than just "h917FFD400000A7F".
It would make the plugin a really unique tool indeed.


I'm not familiar with the SQLQueryPlugin and what formatting capabilites it already has, but this
reminds me of something I did for an own plugin (that unfortunately never got finished) some time
ago. You can use IDEA's plugin system to build plugins for plugins.

In the SQLQueryPlugin, create an interface that might look something like this:

interface CustomFormatter {
String getFormatName();
boolean canFormat(Class type);
String format(Object value);
}

Users can now plug their own formatters into IDEA by writing plugins that register an own
implementation of this interface:

foo.bar.MyFormatter sqlqueryplugin.CustomFormatter ]]>

In the SQLQueryPlugin, you can get a list of all registered formatters by calling

CustomFormatter[] formatters = ApplicationManager.getApplication().getComponents(CustomFormatters.class);

The user can then select between the different formats that are provided for each type. You might
also be able to handle the Hex-Decimal, Date, etc. displays as internal predefined formatters.

Maybe it's too complicated and uncommon to have to write seperate plugins, but I thought I'd
share this idea anyway.


Sascha


0

I think your idea sounds very good and I will see if I can use it.

Sascha Weinreuter wrote:

Oleg Danilov wrote:

>>I'd also like to add my vote to Barry Kaplan's request about custom column formatters.
>>Perhaps we can just associate some names with static methods of some classes
>>like "Reference" -> "my.package.Formatters:formatReference" or so. Such a method could
>>take one Object argument and return a string, for example.
>>These names would appear in right-click list of formats available so by choosing format
>>"Reference" I can display long number 655273556803848831 as much more readable
>>"O.TypeSymptom:A" rather than just "h917FFD400000A7F".
>>It would make the plugin a really unique tool indeed.


I'm not familiar with the SQLQueryPlugin and what formatting capabilites it already has, but this
reminds me of something I did for an own plugin (that unfortunately never got finished) some time
ago. You can use IDEA's plugin system to build plugins for plugins.

In the SQLQueryPlugin, create an interface that might look something like this:

interface CustomFormatter {
String getFormatName();
boolean canFormat(Class type);
String format(Object value);
}

Users can now plug their own formatters into IDEA by writing plugins that register an own
implementation of this interface:

<application-components>
<component>
<implementation-class>foo.bar.MyFormatter</implementation-class>
<interface-class>sqlqueryplugin.CustomFormatter</interface-class>
</component>
</application-components>

In the SQLQueryPlugin, you can get a list of all registered formatters by calling

CustomFormatter[] formatters = ApplicationManager.getApplication().getComponents(CustomFormatters.class);

The user can then select between the different formats that are provided for each type. You might
also be able to handle the Hex-Decimal, Date, etc. displays as internal predefined formatters.

Maybe it's too complicated and uncommon to have to write seperate plugins, but I thought I'd
share this idea anyway.


Sascha


0

Please sign in to leave a comment.