Please I will really appreciate if anyone could point to me what I am doing wrong here. I have been on this for 72 hours now without much success and have reached the point where I need someone to give a hint
on my mistake.
I keep getting this error of "Missing Return Statement" even though I have a return statement. my code snippet is below:
// Method to return an Array Object
//======================================
public Object[][] queryData() {
Connection ThisSqlConnection = mysqlConnection( );
try {
Statement statement = ThisSqlConnection.createStatement();
String SqlQuery = ("select * from Test");
results = statement.executeQuery(SqlQuery);
while (results.next()){
int id = results.getInt("e_id" );
String name = results.getString("name");
int age = results.getInt("age" );
String state = results.getString("state");
String location = results.getString("location");
String date = results.getString("date");
Object[][] dataValues = {{id, name, age, state, location, date}};
return dataValues;
}
}catch ( SQLException ex ){
System.out.println("SQLException:" + ex.getMessage());
}