Forum: Building VoltDB Clients

Post: Testing JDBC connection with SQLLine

Testing JDBC connection with SQLLine
Feb 23, 2015
I wonder if it is possible to establish the connection to VoltDB database via JDBC using the tools like SQLLine (or some other?) ?
When I enter the command on sqlline:
!connect jdbc:voltdb://myvoltdbhost:21212 user1 passw1

I receive an error:
Error: (state=,code=0)

Any thoughts?

Thanks in advance for any response.
Feb 25, 2015
I'm not familiar with SQLLine, but we've successfully run tools such as DBVisualizer and SQuirreL. Check out our voter JDBC sample in the kit for a working example of JDBC:

Feb 25, 2015
Thank you.
The file conatins:
2. Type "voltdb create" to start an empty, single-node VoltDB server.
3. Type "sqlcmd < ddl.sql" to load the schema and the jarfile of procedures into VoltDB.
I am using Linux. I guess the step # 3 should NOT be on the same Linux session. Correct? Could you please clarify this step?

Also, I am running my JDBC (client) connection on the Windows box. Which of the steps listed in the should I perform on the Windows box?

Thanks in advance.
Feb 25, 2015
Step 3 can be run on the same Linux box, but on a separate terminal window. Or you can run the "voltdb create" in the background ("voltdb create --background" will do it) and run sqlcmd from the same command window after the database has started successfully as a background process.

So all those steps can be done on Linux. Once the database is started, you can connect to it via JDBC from any other tool/process. Note that you will need the voltdb client jar file (it has the VoltDB JDBC driver) available to the process running JDBC.