ADH2COB
I'm new here

Fetch Record from database

Jump to solution

How to fetch single record from data base using record id

0 Kudos
1 Solution

Accepted Solutions

Ya i found it below is the code snippet.I used Select class within fs-access jar,

Select select = session.createSelect("tableName");

Equal equal = new Equal("columnName","value for comparision");

select.setConstraint(equal);

EntityList entutyList = session.executeQuery(select);

Entity entity = entityList.get(0);

View solution in original post

0 Kudos
5 Replies
teichmann
Crownpeak employee

Hello,

can you describe more precisely what you want to do?

In which context do you want to get a single database record?
Do you want to get it via script or in an output channel (e.g. html)?

0 Kudos

I have a set of records in data base representing each and every page contents.

I have a built a fsm module.Instead of iterating whole table and find the matching record I wanna fetch single record from data base using record id or some unique value i have wioth me.I want it in java.

0 Kudos

Hello Ajay,

perhaps this blogposting helps you: click

The section "Update" describes how to get an entity via its ID inside a script.

Best regards

Michaela

teichmann
Crownpeak employee

Hello,   

do you need further help or did Michaela Pahl's reply already help you?

If so, it would be great if you marked her reply as "correct answer" so that other community users find the solution easily.

If you have already found a solution by yourself, it would be very kind of you, if you posted it here.   

Best regards,

Jascha

0 Kudos

Ya i found it below is the code snippet.I used Select class within fs-access jar,

Select select = session.createSelect("tableName");

Equal equal = new Equal("columnName","value for comparision");

select.setConstraint(equal);

EntityList entutyList = session.executeQuery(select);

Entity entity = entityList.get(0);

0 Kudos