ERROR: failed to load JDBC driver - org.hsqldb.jdbcDriver
- by maximus
i wrote a connector class to connect to the hsqldb.
here is my code:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.apache.log4j.Logger;
public class hsqlmanager {
        private static final Logger log = Logger.getLogger(hsqlmanager.class);
        private static Connection con=null;
        private static void openConnection(){
            try {
                Class.forName("org.hsqldb.jdbcDriver" );
                log.info("Loaded JDBC Driver");
            } 
            catch (Exception e) {
                log.error("ERROR: failed to load JDBC driver - " + e.getMessage());
                return;
            }
            try {
                con = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/sepm_db","sa","");      
            }
            catch(SQLException e){
                log.error(e.getMessage());
            }
        }
        public static void closeConnection() {
            try {
                con.close();
            }
            catch(SQLException e) {
                log.error(e.getMessage());
            }
        }
        public static Connection getConnection() {
            if (con==null){
                openConnection();
            }
            else {
                try {
                if(con.isClosed()){
                    con = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/sepm_db","sa","");
                }
                }
                catch(SQLException e){
                    log.error(e.getMessage());
                    return null;
                }
            }
            return con;
        }
}
When I compile that I get ERROR: failed to load JDBC driver - org.hsqldb.jdbcDriver. Why?