table1 --------------------------------------
key(int) | question_no(int) | answer(String)
--------------------------------------------
1 1 Hi
2 2 Nice
3 2 Cap
4 3 Good
5 3 Job
6 4 Wow!
I need output this way:-
---------------------------------------------
key(int) | question_no(int) | answer(String)
--------------------------------------------
1 1 Hi
2 2 Nice Cap
3 3 Good Job
4 4 Wow!
Can anyone please help me . i'm like a novice to java. and i cant get this to work.
I know its concatenation but i'm at a lost :-(
Code I wrote in Java:-
============================
java class/ getters-setters
Survey.java
public class Survey implements Serializable
{
private String key;
public String question_no;
private String answer;
public String getkey()
{return key;}
public void setkey(String mK)
{this.key = mK; }
public String getquestion_no()
{return question_no; }
public void setquestion_no(String qdesc)
{this.question_no = qdesc;}
public String getanswer()
{return answer;}
public void setanswer(String qNbr)
{this.answer = qNbr;}
============================================================
main class:-
//This is where is the problem, in the logic. I need help here bad !!
SList = dataTestCtrl.RetriveQuestions(); // function to retrieve the database select * from table1
int size = SList.length;
for (int i=0; i < size ; i++)
{
//THis is where i'm totally lost .. please help..
}
=============================================
Thanks again !
-lucky-
key(int) | question_no(int) | answer(String)
--------------------------------------------
1 1 Hi
2 2 Nice
3 2 Cap
4 3 Good
5 3 Job
6 4 Wow!
I need output this way:-
---------------------------------------------
key(int) | question_no(int) | answer(String)
--------------------------------------------
1 1 Hi
2 2 Nice Cap
3 3 Good Job
4 4 Wow!
Can anyone please help me . i'm like a novice to java. and i cant get this to work.
I know its concatenation but i'm at a lost :-(
Code I wrote in Java:-
============================
java class/ getters-setters
Survey.java
public class Survey implements Serializable
{
private String key;
public String question_no;
private String answer;
public String getkey()
{return key;}
public void setkey(String mK)
{this.key = mK; }
public String getquestion_no()
{return question_no; }
public void setquestion_no(String qdesc)
{this.question_no = qdesc;}
public String getanswer()
{return answer;}
public void setanswer(String qNbr)
{this.answer = qNbr;}
============================================================
main class:-
//This is where is the problem, in the logic. I need help here bad !!
SList = dataTestCtrl.RetriveQuestions(); // function to retrieve the database select * from table1
int size = SList.length;
for (int i=0; i < size ; i++)
{
//THis is where i'm totally lost .. please help..
}
=============================================
Thanks again !
-lucky-