to read any value from content resolver you can access it via its uri. like
adb shell content query --uri content://sms --projection _id,address,body,read,date,type
pass this command in exec, you will get the result like
Row: 0 _id=2, address=5554, body=Testing, read=1, date=1469533087074,
type=2
Row: 1 _id=1, address=5554, body=Hi, read=1,
date=1469533011944, type=2
you can get specific sms using specific uri
content://sms/inbox
content://sms/sent
it will helpful to you.
Update
you can run it from java code like
Process process = Runtime.getRuntime().exec(new String[]{"su","-c","content query --uri content://sms --projection _id,address,body,read,date,type"});
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));