Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't connect to derby database

Status
Not open for further replies.

viclap

Programmer
Oct 12, 2000
39
PH
Hi to All,

I'm new to Java and having an error in my database application using embedded derby database. I'm using netbeans 5 as my IDE.

java.lang.ClassNotFoundException:eek:rg.apache.derby.jdbc.EmbeddedDriver
java.lang.NullPointerException

Code:

private void ConnectToDatabase ()
{
try
{ Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
//make connection
con= DriverManager.getConnection("jdbc:derby:Sample;user='nbuser';password='nbuser'" );

//create statement
st = con.createStatement();
}
catch (Exception e) {System.out.println(e);}
}

Any Help will be appreciated.
 
You don't have the driver jar file on your classpath.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top