hii guys here is the simple code through which i am trying to make the connection but it still getting error .. i followed each and every step given in the netbeans tutorial but still having connection problem dont know what to do ..plzz help ..
import java.sql.*; public class samp { /** * @param args the command line arguments */ public samp() { } public static void main(String[] args) { try{ Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); }catch(ClassNotFoundException e){ System.out.println(e); } try{ Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/career", "admin", "admin"); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM APP.STUDENTSS"); while (rs.next()) { String s = rs.getString("name"); String n = rs.getString("college"); System.out.println(s + " " + n); } }catch(SQLException e){ System.err.println(e); } } }
error :run: java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/career BUILD SUCCESSFUL (total time: 0 seconds)