Problem with select and transmit content

1
0
-1

Hi,

I try to fill a select list with the content of the database field (id)
So I can fill the select list with the id's of my database but when I try to send the value to an another form I can't.

I have on the component an error of type field.

My code:
1) I create a Pool variable : listofId (java.util.List)
2) I create a connexion in
2.1) I edit expressions with that code :
def script = ""
script ="SELECT Id FROM demo"

3) The code and the last screen
http://s15.postimg.org/l6q6gzitn/screen_for_the_code.png

Regards
BLE

1 answer

1
0
-1

try this

``
import java.sql.ResultSetMetaData;

List list = new ArrayList();

resultset.beforeFirst();

while (resultset.next()) {
list.add(resultset.getString("id"));
}

return list;
``

remplace id with your column name.

Comments

Submitted by ble on Mon, 02/22/2016 - 12:55

Hi,

Can you explain me where I put this code! and how too use it to export value with the select component

Regards
BLE

Submitted by m.errafay123 on Mon, 02/22/2016 - 13:09

this is only to retrieve data from database. replace your resultset with it. i dont quiet understand "export value" ? are you trying to Insert your selected value into the database ? if that so , i'm having same issue and waiting for a solution. sorry my friend.

Submitted by ble on Mon, 02/22/2016 - 13:24

Ok, thank's for your answer, but I can retrieve my data dro the database ans insert it into the select, I just need to export the value selected to the other form.

If I find a solution, I upload it.

Regards
BLE

Notifications