javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial Tomcat provides a naming service that you can access via JNDI from your web application. You probably declare the Tomcat connection pool in a Tomcat XML configuration file (server.xml). In your web application, you're looking up the database connection pool that Tomcat has put in the naming directory for you.
When you run a stand-alone application (outside of Tomcat), you don't have access to Tomcat's naming service directly. So when you try to lookup something via JNDI, it will not be found - JNDI isn't even configured (that's what the error message says).
Ofcourse you can access the database from a stand-alone application, but you can't use Tomcat's connection pool easily; you need to make sure that you connect to Tomcat's naming service to do this. It might be easier to just make a directy
JDBC connection to the database from your stand-alone tool. The stand-alone tool is a tool to backup the database, isn't it? It doesn't really need to use a connection pool anyway. (One of the reasons to use a connection pool in a web app is to control the number of connections to the database, regardless of how many users are using the web app - your backup tool just needs 1 connection).