Hi all
I am new to java programming.
I need a litte helop.
I want to take some results from database so i am trying to connect to database. I have dowloaded jdbcmysql connector but having no idea how to add it in eclipse or jre. Plus i am having this code so please check and tell where might be i'm wrong
Statement stmt;
ResultSet rs;
Class.forName("com.mysql.jdbc.Driver");
String connectionUrl = "jdbc:mysql://localhost/test?user=root&password=";
Connection con = DriverManager.getConnection(connectionUrl);
stmt= con.createStatement();
rs=stmt.executeQuery("select * from atunesblue");
String pname=rs.getString("projectname");
String pnm = "atunesblue";
while(rs.next()){
if(pnm.equalsIgnoreCase(pname))
{
System.out.println("Mubarkaannnnnnnnnnn");
}
else
{
System.out.println("fitay munh");
}
}
}
catch (Exception e){
System.out.println(e.getMessage());
}
any help will be appreciated.
in response i am getting this as output
"Before start of result set"