Forum: Managing VoltDB

Post: 3rd party Voltdb management tool

3rd party Voltdb management tool
Alexey
Apr 9, 2013
Hi!
Is there some multiplatform management tool which could be used to connect voltdb from Windows?
I tried to use squirrel 3.4 (http://squirrel-sql.sourceforge.net/) to connect voltdb via odbc but get exception:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class org.voltcore.utils.DBBPool
	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
	at java.util.concurrent.FutureTask.get(FutureTask.java:91)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class org.voltcore.utils.DBBPool
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
	... 6 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.voltcore.utils.DBBPool
	at org.voltdb.messaging.FastSerializer.<init>(FastSerializer.java:98)
	at org.voltdb.messaging.FastSerializer.<init>(FastSerializer.java:72)
	at org.voltdb.messaging.FastSerializer.<init>(FastSerializer.java:56)
	at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:169)
	at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:143)
	at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:118)
	at org.voltdb.client.Distributer.createConnectionWithHashedCredentials(Distributer.java:606)
	at org.voltdb.client.ClientImpl.createConnectionWithHashedCredentials(ClientImpl.java:165)
	at org.voltdb.client.ClientImpl.createConnection(ClientImpl.java:536)
	at org.voltdb.jdbc.JDBC4ClientConnection.<init>(JDBC4ClientConnection.java:141)
	at org.voltdb.jdbc.JDBC4ClientConnectionPool.get(JDBC4ClientConnectionPool.java:83)
	at org.voltdb.jdbc.Driver.connect(Driver.java:91)
	at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
	at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
	... 8 more

Before connecting to database I copied voltdb driver voltdbclient-3.1.jar to squirrel lib directory.
Used Jdbc url: jdbc:voltdb://<voltdb ip>:21212
Also I tried to use jdbc:voltdb://<voltdb ip> (without port).

VoltDb is running with Voter example. I able to connect to it from localhost using VoltDB Studio. Also I able to connect to voltdb (and call stored procedures) using C# driver from windows 7 computer where squirrel is installed.
bballard
Apr 9, 2013
Hi Alexey,

I've used SquirrelSQL to connect to VoltDB using the JDBC driver. This is on Mac OS X, but it should work the same on Windows, with the exception that your URL won't be "localhost" in that case. I'm attaching a screenshot image of the Driver settings. Here is the relevant information:

Driver
Name: org.voltdb.jdbc.Driver
Example URL: jdbc:voltdb://localhost:21212
Website URL:

Extra Class Path:
/opt/voltdb/voltdb/voltdbclient-3.0.jar
/opt/voltdb/lib/guava-12.0.jar

Class Name: org.voltdb.jdbc.Driver

When I first tried this just with the voltdbclient-3.0.jar file, I got some errors, but those were resolved by adding the guava-12.0.jar file, so you have to add that together with the Driver file.
Alexey
Apr 9, 2013
Thank you! It works.
How to execute stored procedures from squirrel. I can select data from tables or views using "select" statement but can not execute SP. I try to run following sql-script:
execute Results

and get error:

Error: Invalid SQL statement type.
SQLState: s1012
ErrorCode: 0
bballard
Apr 9, 2013
Hi Alexey,

To be honest, I have not tried to call stored procedures from SQuirreLSQL before, I've only set it up to help someone else with the JDBC setup, and it was only used for SQL statements.

I spent a few minutes just now looking into how to call stored procedures in SQuirreLSQL and it seems that the application doesn't allow calling stored procedures unless there is a plug-in for the particular database. I got the same error as you, it seems to be generated by SQuirreLSQL without sending anything to the database. In the Object browser, you can see info about the Procedures, but not run them.

An alternative I suggest is for you to use VoltDB Studio, which is our web interface which allows you to call stored procedures as well as run ad hoc SQL statements and monitor performance. If you have enabled the HTTP server in your deployment.xml file (it is enabled by default) then you can open a browser to the URL:
http://<voltdb hostname or ip>:8080/studio

Thanks,
Ben
boedjel
Apr 16, 2013
Please ignore my question below. The root cause was the firewall and SElinux settings which must be disabled before trying to connect to VoltDB. My bad...

---------
Hi Ben,

My SQuirrel SQL and VoltDB reside on different hosts. I already added voltdbclient-3.1.jar and guava-12.0.jar in the extra class path. But I still couldn't connect to VoltDB. Do I have to provide User Name and Password also? Is the User Name in SQuirrel SQL the same as OS (linux) username who owns VoltDB?

Regards,
Budi