[jboss-user] [JBoss Tools (users)] - How to Connect hsqldb from eclipse using Servlet or jsp

nanda143kumar do-not-reply at jboss.com
Sat Feb 21 03:03:59 EST 2009


Jboss portal + Jboss AS as my Server
Embedded Hsql  as db
and 
eclipse as my IDE..

please tell me how to connect hsqldb from eclipse using Servlet's or jsp


this is code i have used 
package pms;
import java.sql.*;


public class First {
	public static void main(String args[])
	{
	try {
	    Class.forName("org.hsqldb.jdbcDriver" );
		System.out.println("hi");
	    Connection con= DriverManager.getConnection("jdbc:hsqldb:hsql:pms", "sa", "");
	    System.out.println("connection established");
	    Statement st=con.createStatement();
	      String s="create table student(sid integer,sname varchar(20))";
	      ResultSet rs=st.executeQuery(s);
	      System.out.println("values inserted");
	}
	catch (Exception e) {
	    System.out.println("ERROR: failed to load HSQLDB JDBC driver.");
	    e.printStackTrace();
	    return;
	}

}
}

but i am getting an exception at  
Connection con= DriverManager.getConnection("jdbc:hsqldb:hsql:pms", "sa", "");

please help me out...

regards
Nanda Kumar




View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4212017#4212017

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4212017



More information about the jboss-user mailing list