0 Replies Latest reply on Feb 20, 2009 2:30 AM by Nanda Kumar

    how to connect hsqldb from eclipse using servlet's or jsp's

    Nanda Kumar Newbie

      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