I like the new capability to run a select statement and the columnData is available in the callbackFunction.
I need to use a prepared statement to protect us from sql injection so I know I need to use the direct jdbc access.
Is the only way to build the equivalent of columnData to loop through each column and get the object?
Thanks
db Direct Access prepared statements
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
You create a sql statement, then execute it which returns a result set, then loop through the rows of the result set extracting column values. There's an example here http://forum.ebasetech.com/forum/viewtopic.php?t=1020. To get the protection against sql injection you need to use question marks (?) in the where clause of your statement and then substitute variables into this.
0 x
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
Thanks Jon, in this case I happen to have an object available that stores all the columns in the query. I can just loop through them and build the object.
I'll have a look at the metadata and see what I can find as it will make it more robust; especially if I use select * from xyz in the future.
Thanks again.
I'll have a look at the metadata and see what I can find as it will make it more robust; especially if I use select * from xyz in the future.
Thanks again.
0 x
Who is online
Users browsing this forum: No registered users and 13 guests