Null Pointer Exception while trying to connect to Derby database
843859Mar 26 2008 — edited Mar 27 2008Hello,
If anyone can help...it's so urgent
I'm not able to connect to my database
Everytime I get a nullpointerException at this point of my code:
Statement st=c.createStatement();
ResultSet rs=st.executeQuery(sql);
NB: I created the connection with:
private static String ODBCdriver="org.apache.derby.jdbc.ClientDriver";
private static Connection conn;
// Load the ODBC driver
try {
Class.forName(ODBCdriver);
conn = DriverManager.getConnection("jdbc:derby://localhost:1527/Carte_Menu","carte","cartemenu");
}
what should I do??why I get this exception??:(
(if this would help: I'm using netbeans 6.0 on Windows vista)