-1

I want to get the DAO list values in controller.like my list contain 10 values i want all the 10 values in controller in 10 separate object or variable.`public List getcountrydata() throws Exception {

    conn = connectionDB.getConnection();
    Statement stmt = conn.createStatement();
    List<wrapper> list = new ArrayList<wrapper>();
    list.clear();
    ResultSet rs1 = stmt.executeQuery("select * from country ORDER BY country_code ASC");
    while (rs1.next()) {
        wrapper obj1 = new wrapper();
        obj1.setCountry_name(rs1.getString("country_name"));
        obj1.setCountry_id(rs1.getInt("country_id"));
        list.add(obj1);
    }
    return list;
}`

From the above code I want to get the country_name and country_id in controller in separate variable like, String country_name=country_name; int country_id=country_id;

vijay
  • 107
  • 1
  • 6
  • 3
    Welcome to Stack Overflow. SO is not a place where you can just ask for code, you have to try it first yourself. Please add a starting point in code to get a proper and quick answer to your question. See also http://stackoverflow.com/help/mcve – Roy Jan 27 '17 at 10:30
  • I'm so confused.. Have you tried something at least? – Dr. Roggia Jan 27 '17 at 10:31
  • Check this [post](http://stackoverflow.com/questions/8627902/new-line-in-text-area) – StackUseR Jan 27 '17 at 10:34

2 Answers2

1

Use Environment.NewLine where you want to need new line after EOL.

Hope that will help you.

Ruchika_C
  • 21
  • 3
1

If you are trying to show/save the text of the TextBox you need to create a JavaScript function which runs on submit button push, The process of this function is to change every enter key pressed into <br/> this would show as well as save requirement Format.

aparna rai
  • 823
  • 10
  • 24