Forum: Building VoltDB Applications

Post: Tips on integrating w/existing Eclipse project?

Tips on integrating w/existing Eclipse project?
Dec 11, 2010
Hi. I'd like to integrate voltdb into an existing Eclipse application
(thinking to just replace the calls within the existing DAO classes to voldtb procedure calls),
does anyone have any pointers on the best approach to do that?
I imported the project created by the 'generate' script, but I'm not
sure if I can just copy the voltdb procedures into my current package?
(Currently I just export my project as a war to run under an external instance of Jetty)
Well, procedures are just java...
Dec 13, 2010
VoltDB stored procedures are 100% java, so you can edit and work with them in just about any way you can work with Java.

So yes, you can import them into an Eclipse project under whatever package name you like. They do depend on the VoltDB jarfile that came with your download of VoltDB, so you might want to add that into the eclipse build path. This will let you edit your procedures and will allow you to use Eclipse's compiler to check that they compile.

Creating a VoltDB Application Catalog jarfile is still going to be a manual step. In the generated project, you'll need to update the Ant buildfile and then you should be able to run "ant compile" to generate the application catalog. If you have moved things around a lot, you may need to adjust the Ant buildfile more. It's likely there's a way to automate the VoltDB compile step in Eclipse, but I haven't bothered to figure that out.

Finally, since there's no need to have procedures distributed in your WAR file, and also since you want to be careful about depending on code in your main project, you might want to create a secondary project for the VoltDB procedures to keep them logically isolated.