Hei, im trying to connect to h database, via my java program but having problems with my driver issue. I am using ATOM editor not Eclipse or NetBeans!! How can I run my java program via ATOM editor?? I know that i need to include the HSQL JDBC driver in my class path but how can i do that? Here is my code:
import java.sql.Connection;
import java.sql.DriverManager;
public class ConnectDatabase {
public static void main(String[] args) {
Connection con = null;
try {
//Registering the HSQLDB JDBC driver
Class.forName("org.hsqldb.jdbc.JDBCDriver");
//Creating the connection with HSQLDB
con = DriverManager.getConnection("jdbc:hsqldb:mem:.", "SA", "");
if (con!= null){
System.out.println("Connection created successfully");
}else{
System.out.println("Problem with creating connection");
}
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
}