Sure, JDBC will allow one to access a DB with all of the privileges of the User/Password that you use to connect to the DB.
Depending upon how you want to do it, create a PreparedStatement, set the SQL
string property and the run the appropriate execute method. This will return a ResultSet that will contain the row you desire.
I can give you a short example iffin you need more info.