Hi i’m working on an application and I’ve just started toying with SQL I’ve set up a database with all my information and what not now i need to be able to get the values and i haven’t been able to figure it out.
What I’d like is a java method which i can pass the column name and row id and have it return the value.
For instance if my table were like this
--------------
| _id | data |
--------------
| 1 | cat |
| 2 | dog |
| 3 | fish |
--------------
I would like to call the method say getValue(2, data); and it would return dog any help with this would be greatly appreciated as i haven’t been able to figure this seemingly easy problem out
Thank you!
Something like this:
MY_TABLEis the table you are querying,colsis aStringarray containing the columns you’re retrieving, andargsis aStringarray containing the ID argument.