[ANN] SQLQueryPlugin version 1.3.7 released
I've just uploaded the newest release of my JDBC/SQL plugin.
http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin
Changes:
Added support for AS/400 and Informix driver
Allow refresh of result tables
Bye,
Stefan.
Please sign in to leave a comment.
The database struture can`t display very well as before in the SQL Schema.
The Functions,Procedures,Data Types can display .The table information can`t,while it`s very important for developer.
If the procedures are displayed correctly it looks like the used JDBC driver doesn't support the method DatabaseMetaData.getTables() like I use it.
You could try to execute the following small code snippet.
Regards,
Stefan.
return all of the table information .
Maybe something wrong when add the tablesNode.
Did the first, the second or both variants of getTables() work?
The same occurs using the Sybase JConnect driver: no tables displayed in the schema
For the Sybase driver the problem lies probably in a wrong name of the current schema. The current schema name
differs from database to database, for Oracle the schema name equals the user name and for MySQL the schema name
equals the database name. If you give me the right schema name I can implement it in the next release.
Bye,
Stefan.
Paul Wilton wrote:
Both work.
the catelog is the dbname,the schemaname is the username!
execute
1.metaData.getTables("authdb","informix",null,new String[]{"TABLE"})
return all of the "TABLE" belong to the "informix"
2.metaData.getTables("authdb","informix",null,null)
return all of the "SYSTEM TABLE|TABLE|VIEW|UNKNOWN"
Hi Stefan,
A while back I started to experience long delays before the execution of a query (I guess the problem has been mentioned by some other users as well). The problem is still there in 1.3.7.
The time is not spent trying to connect to the database, once the plugin attempts to connect the things move really fast (and the code connecting to the same database using the same connection and driver does not have any problems at all).
During the "wait", the CPU is quite loaded (about 60%) and IDEA's UI hangs, although nothing seems to happen. This lasts for about 6-8 seconds for any query.
I'm using a DB2 database. Here's a thread dump taken during the "wait".
Thanks again for a great plugin,
Andrei
-
Full thread dump Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode):
"Keep-Alive-Timer" daemon prio=9 tid=0x05320750 nid=0xeb8 waiting on condition
at java.lang.Thread.sleep(Native Method)
at sun.net.www.http.KeepAliveCache.run(KeepAliveCache.java:149)
at java.lang.Thread.run(Thread.java:534)
"EditorCaretThread" prio=7 tid=0x03a2e7a0 nid=0x7c0 waiting on condition
at java.lang.Thread.sleep(Native Method)
at com.intellij.openapi.editor.a.m$bh_.run(m$bh_.java:20)
"Thread-8" prio=7 tid=0x04e484b0 nid=0x1e8 in Object.wait()
at java.lang.Object.wait(Native Method)
- waiting on (a java.lang.Object) at org.tmatesoft.tmate.A.F.run(Unknown Source) - locked <0x11853f08>]]> (a java.lang.Object)
"Thread-6" daemon prio=7 tid=0x04e52100 nid=0xe88 in Object.wait()
at java.lang.Object.wait(Native Method)
- waiting on (a java.util.TaskQueue) at java.util.TimerThread.mainLoop(Timer.java:429) - locked <0x11529b68>]]> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:382)
"AWT-EventQueue-1" prio=7 tid=0x03928210 nid=0x3e8 runnable
at java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
at java.io.File.isDirectory(File.java:701)
at java.io.File.toURL(File.java:572)
at com.kiwisoft.utils.Utils.getProjectClassLoader(Unknown Source)
at com.kiwisoft.sqlPlugin.QueryPanel.executeStatement(QueryPanel.java:312)
at com.kiwisoft.sqlPlugin.QueryPanel.executeStatement(QueryPanel.java:302)
at com.kiwisoft.sqlPlugin.QueryPanel$ExecuteAction.actionPerformed(QueryPanel.java:398)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1530)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2438)
at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:253)
at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:202)
at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2515)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2507)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2401)
at java.awt.Component.processEvent(Component.java:4909)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:627)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:831)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:741)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:592)
at java.awt.Component.dispatchEventImpl(Component.java:3506)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at com.intellij.ide.q.b(q.java:101)
at com.intellij.ide.q.a(q.java:75)
at com.intellij.ide.q.dispatchEvent(q.java:46)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
"Thread-5" prio=7 tid=0x036ffc30 nid=0x8b4 waiting on condition
at java.lang.Thread.sleep(Native Method)
at com.intellij.progress.ProgressManager$2.run(ProgressManager.java:4)
"com.jniwrapper.NativeResourceCollector" daemon prio=7 tid=0x038630e0 nid=0x978 in Object.wait()
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
- locked ]]> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
at com.jniwrapper.e.run(SourceFile:58)
"Thread-2" daemon prio=7 tid=0x03824780 nid=0xf6c in Object.wait()
at java.lang.Object.wait(Native Method)
- waiting on (a java.util.TaskQueue) at java.util.TimerThread.mainLoop(Timer.java:429) - locked <0x1121dba8>]]> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:382)
"TimerQueue" daemon prio=5 tid=0x03664028 nid=0x944 runnable
at java.lang.Object.wait(Native Method)
at javax.swing.TimerQueue.run(TimerQueue.java:231)
- locked ]]> (a javax.swing.TimerQueue)
at java.lang.Thread.run(Thread.java:534)
"StoreRefreshStatusThread" prio=2 tid=0x03a350b0 nid=0xc48 waiting on condition
at java.lang.Thread.sleep(Native Method)
at com.intellij.openapi.vfs.a.a.g$b_.run(g$b_.java:5)
"WatchForChangesThread" prio=7 tid=0x0379ca20 nid=0x9c0 runnable
at com.intellij.vfs.local.win32.FileWatcher.waitForChangeImpl(Native Method)
at com.intellij.vfs.local.win32.FileWatcher.c(FileWatcher.java:8)
at com.intellij.openapi.vfs.a.a.g$c_.run(g$c_.java:5)
"AlarmThread" prio=5 tid=0x03774b00 nid=0xc50 in Object.wait()
at java.lang.Object.wait(Native Method)
at com.intellij.util.Alarm$MyThread.run(Alarm.java:54)
- locked ]]> (a java.lang.Object)
"AlarmThread" prio=5 tid=0x03774988 nid=0x41c in Object.wait()
at java.lang.Object.wait(Native Method)
at com.intellij.util.Alarm$MyThread.run(Alarm.java:54)
- locked ]]> (a java.lang.Object)
"AWT-Shutdown" prio=7 tid=0x037676f8 nid=0xa40 in Object.wait()
at java.lang.Object.wait(Native Method)
- waiting on (a java.lang.Object) at java.lang.Object.wait(Object.java:429) at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259) - locked <0x10f82fa0>]]> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:534)
"Thread-1" daemon prio=5 tid=0x03724b28 nid=0x280 in Object.wait()
at java.lang.Object.wait(Native Method)
- waiting on (a java.util.TaskQueue) at java.util.TimerThread.mainLoop(Timer.java:429) - locked <0x10f8e3d0>]]> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:382)
"SocketListenerThread" prio=5 tid=0x03767198 nid=0x238 runnable
at java.net.PlainDatagramSocketImpl.receive(Native Method)
- locked (a java.net.PlainDatagramSocketImpl) at java.net.DatagramSocket.receive(DatagramSocket.java:711) - locked <0x10f90bc0> (a java.net.DatagramPacket) - locked <0x10f90be0>]]> (a java.net.DatagramSocket)
at com.intellij.licensecommon.c.a.e.b(e.java:28)
at com.intellij.licensecommon.c.a.f.run(f.java:2)
"MessageDeliveryThread" prio=5 tid=0x03764f08 nid=0xd68 in Object.wait()
at java.lang.Object.wait(Native Method)
- waiting on (a java.lang.Object) at java.lang.Object.wait(Object.java:429) at com.intellij.licensecommon.c.r.run(r.java:23) - locked <0x10f90c68>]]> (a java.lang.Object)
"Java2D Disposer" daemon prio=10 tid=0x03762e60 nid=0x9d8 in Object.wait()
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
- locked ]]> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
at sun.java2d.Disposer.run(Disposer.java:100)
at java.lang.Thread.run(Thread.java:534)
"AWT-Windows" daemon prio=7 tid=0x03724d68 nid=0xcd4 runnable
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(WToolkit.java:262)
at java.lang.Thread.run(Thread.java:534)
"Lock thread" prio=5 tid=0x0366ce68 nid=0xdb4 runnable
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
- locked ]]> (a java.net.PlainSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:448)
at java.net.ServerSocket.accept(ServerSocket.java:419)
at com.intellij.idea.d$b_.run(d$b_.java:5)
at java.lang.Thread.run(Thread.java:534)
"Signal Dispatcher" daemon prio=10 tid=0x00aa2aa8 nid=0xd70 waiting on condition
"Finalizer" daemon prio=9 tid=0x00aa0428 nid=0x87c in Object.wait()
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
- locked ]]> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
"Reference Handler" daemon prio=10 tid=0x00a9eff8 nid=0xd0 in Object.wait()
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:429)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
- locked ]]> (a java.lang.ref.Reference$Lock)
"main" prio=5 tid=0x009152c0 nid=0x908 waiting on condition
"VM Thread" prio=5 tid=0x00adb720 nid=0xbd8 runnable
"VM Periodic Task Thread" prio=10 tid=0x0091fe40 nid=0xc4c waiting on condition
"Suspend Checker Thread" prio=10 tid=0x00aa2960 nid=0xc2c runnable
SS> I've just uploaded the newest release of my JDBC/SQL plugin.
SS>
SS> http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin
SS>
SS> Changes:
SS> * Added support for AS/400 and Informix driver
SS> * Allow refresh of result tables
SS> Bye,
SS> Stefan.
It looks like this is caused by the creation of the project ClassLoader, which is used for loading BLOB's.
I will make this configurable in the next release.
Bye, Stefan.
Andrei Oprea wrote:
I use "Execute/select * from XXXX" on "SQL Schema window" while there is no query tab on "SQL window".
It can't work.
It only works while there are more than one query tab on "SQL window".
The encoding of exported file is not correct.
The table view can display Chinese, but the exported file can't show Chinese.
Hi All,
Plugin looks great, but I can't figure out how to use
variable binding (? parameters).
I put query as "SELECT * FROM xxx WHERE id = ?"
and trying to click on 1-2-3 icon on the toolbar but nothing happens. 8-(
Conection and setup looks ok since "SELECT * FROM xxx" works fine.
try
"SELECT * FROM &table; WHERE id = &pk;"
this should help.
Addionally:
The editor supports syntax highlighting and the variable are show in brown.
Sven
Opps: I've just seen that the button does not work any more.
Andrei Tokar wrote:
The variable format is: &<identifier-string>; like &var1;. The variable must not appear between ''.
The button 'Use Variable Bindings' must be pressed to enable the binding. The bindings is different to the binding of the JDBC driver but replaces
the variable with the string entered as variable value such that if you have a string variable you have to use '' in the value string.
Regards,
Stefan.
I've just uploaded version version 1.3.8. You could see if this fixes your problem.
cosmoboy wrote:
Stefan,
Is there a reason that you chose not to use the standard variable binding
provided by the JDBC driver?
It would be really nice if I could cut a SQL statement out of my data access
class that includes ? characters for the variables that need binding and it
would pop up a dialog asking me to provide values to bind to the variables.
Right now I have to edit my SQL statements in the query editor every time I
want to check something. And I have to change them back to paste them into
my code.
Automatically removing double quotes (as well as any String concatenations)
when pasting into the query editor would also be sweet.
Thanks,
Tim
"Stefan Stiller" <stefan.stiller@net-linx.de> wrote in message
news:c3eelm$1ve$1@is.intellij.net...
must not appear between ''.
>
The bindings is different to the binding of the JDBC driver but replaces
have a string variable you have to use '' in the value string.
>
+1 to Tim's. Doing real binding may sometimes prove useful because statement's behavior may be different in those two cases and you most likely will try to run you SQL in a hope that it will behave exactly the same as in application. &<name>; syntax for variables is a bit counter-intuitive and yes, my app SQL may be half-screen long and I don't want to edit it, just cut and paste. In applications I wrap JDBC with class which allows for named variables binding, so may I suggest syntax, I am using there: ?/<name>/ - easy to parse while still a valid SQL.
There are some reasons to use string replacement instead of real jdbc-like
binding:
1. you do not need to know anything about the statement and the syntax of
the sql slang - to identify the type of binding
2. you can use speaking names to identify what is used for what
3. you can reuse the same variable multiple times
PS: the style of this variables has been adapted from oracle's sqlplus tool.
PS2: copying the statement text from the editor into the plugin's editor
should replace ? per default by &1;, &2; and so on...
Sven
Tim Haley wrote:
>> The variable format is: &<identifier-string>; like &var1;. The variable
>>
>> The button 'Use Variable Bindings' must be pressed to enable the binding.
>> the variable with the string entered as variable value such that if you
>>
>> Regards,
>> Stefan.
Like you can hide you head in a sand - my applications are still use parameter binding (and for a reason). And what "slang" you are talking about? I think most of us use JDBC types in 99% of the cases (LOBs are probably an exception 8-( ).
Same goes for ?/]]>/
Same goes for ?/]]>/
Agreed - it would be nice
I can't use ctrl + mouse click to show contextual menu on Mac OS X.
On Mac, there is only one mouse button by default.
On Mac, Using ctrl + mouse click is instead of right mouse button click.
When I use touchpad on my PowerBook(only one button), I can't use ctrl + touchpad button to show contextual menu.
Andrei Tokar wrote:
>> There are some reasons to use string replacement
>> instead of real jdbc-like
>> binding:
>> 1. you do not need to know anything about the
>> statement and the syntax of
>> the sql slang - to identify the type of binding
Can you use statements like 'select * from &table; &where;' ? I know the
sample is not really fancy, but I think you are understanding what I
mean....
Slang - I meant the different kind ouf joining tables in statements. See
Oracle vs. MS SQL/Access as example. You need to consider this, if you like
to bind analyse the statement parameter types. It makes a difference, if
you are binding a date column as date or let the database do the
conversion. bind(int, Object) has another effect than bind(int, Date);
especially, if you like to consider time values of dates for example.
So "&date;" replacing by "to_date('2004-03-22','YYYY-MM-DD')" is clear
enough and you have the freedom to use your db specific functions instead
of burding all the stuff to the plugin.
>> 2. you can use speaking names to identify what is
>> used for what
Wouldn't this bring a new kind of syntax into the plugin? Following the jdbc
standard the plugin has only to support the "?" and would show you as
variables dialog:
var value
-
1 ...
2 ...
>> 3. you can reuse the same variable multiple times
>> PS2: copying the statement text from the editor into
>> the plugin's editor
>> should replace ? per default by &1;, &2; and so on...
I hope Stefan will read this and have time for it. :)
Sveb
Absolutely, but what I am talking about, is ability to specify parameter's time EXPLICITELY along with parameter's value. Than no guessing from plugin is needed
What about ?/date/, or fine, let it be &date;... but plugin should use stmt.setDate(i, param) or may be stmt.setTimeStamp(i, param) (please try to guess which one?) instead of doing some string substitutions on SQL itself.
At the end of the day, that is probably what application in development will do, isn't it?
Both type of bindings have some advantages and I will see if I can additionally implement the normal JDBC binding.
The only problem I see so far is that I believe the /.../ syntax for comments was introduced in the SQL99 standard.
It's therefore possible that some databases don't support these kind of comments.
Bye,
Stefan.
Andrei Tokar wrote:
>>Slang - I meant the different kind ouf joining tables
>>in statements. See
>>Oracle vs. MS SQL/Access as example. You need to
>>consider this, if you like
>>to bind analyse the statement parameter types. It
>>makes a difference, if
>>you are binding a date column as date or let the
>>database do the
>>conversion. bind(int, Object) has another effect than
>>bind(int, Date);
>>So "&date;" replacing by
>>"to_date('2004-03-22','YYYY-MM-DD')" is clear
>>enough and you have the freedom to use your db
>>specific functions instead
>>of burding all the stuff to the plugin.
where can i download the new version?
Great, It`s working!Thanks.
But the functions is so little to reference,especially the String functions,only two!
Attachment(s):
functions.JPG
If the JDBC driver doesn't return more functions I can't change it.
cosmoboy wrote: