Under your netbeans project right click on libraries and add the H2 jar.


On Mon, May 24, 2010 at 11:18 PM, Okashira <[email protected]> wrote:

> Hello, I try to connect with H2 JDBC Driver on Net Beans as code
> below:
>
> public class Conect_Test_JDBC_H2 {
>
>    public static void main (String args[]){
>
>        try{
>            Class.forName("org.h2.Driver");
>            Connection con = DriverManager.
>            getConnection("jdbc:h2:~/test", "sa", "");
>
>            JOptionPane.showMessageDialog(null, "Connection OK!");
>
>            con.close();
>            System.exit(0);
>
>        }catch(ClassNotFoundException e){
>            JOptionPane.showMessageDialog(null, e);
>        }catch(SQLException e){
>            JOptionPane.showMessageDialog(null, e);
>        }
>    }
> }
>
> but this returns the following message:
>
> "java.lang.ClassNotFoundException: org.h2.Driver"
>
> Could help me!
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<h2-database%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
>
>


-- 
Alexander Berry, Jr.
Software Engineer
Core Java Development
[email protected]

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to