[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - how to connect hsqldb from eclipse using servlet's or jsp's

nanda143kumar do-not-reply at jboss.com
Fri Feb 20 02:31:16 EST 2009


Hi everyone i m using 
 Jboss portal + Jboss AS as my Server
Hsql  as db
and 
eclipse as my IDE..

please help me in connecting 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=4211698#4211698

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



More information about the jboss-user mailing list