The setup of my app:
and the error that is thrown:
Hello, I am pretty new to java and netbeans. I previously worked on Adobe Flash. I am having this problem where error of db or table not found is being thrown. If anybody could makeout anything from the screenshots attached, Please help me. I am trying to use the derby.jdbc.EmbeddedDriver here to store data.
Below is the entire code.
package loginapp;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
public class Loginapp {
public static void main(String[] args) {
// TODO code application logic here
try
{
chkLogin();
}
catch(Exception e){
e.printStackTrace();
}
}
private static void chkLogin() throws Exception{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
Connection conn = DriverManager.getConnection("jdbc:derby:testdb;create=true");
Statement stmnt = conn.createStatement();
ResultSet results = stmnt.executeQuery("select * from USERLOGIN");
ResultSetMetaData rsmd = results.getMetaData();
int numCols = rsmd.getColumnCount();
for(int i=0;i<=numCols;i++)System.out.print(rsmd.getColumnLabel(i)+"\t\t");
}
}
Have included derby.jar in my library and the "jdbc:derby:testdb;create=true [user1 on APP]" points to the db. Am able to update when I do it from the SQL window.
Thank you