Relative Content

Tag Archive for javaandroidsql-serverandroid-studio

Saving fingerprint data into database [duplicate]

This question already has answers here: can we use the inbuilt Fingerprint scanner to use as attendance scanner? (2 answers) Fingerprint enrolment for hundreds of users on Android and syncronise them to a main server (1 answer) Identify different users on a single android device using Fingerprint (1 answer) Can I obtain fingerprint value? (1 […]

Handling SearchView Input for Flexible Data Retrieval

The Problem is I Using the SearchView Enter the text(Example:the item name is OIL FILTER INNOVA.I Enter the full text and click the search button it is filter working fine the data is retrieved. But at the same time I Enter the OIL or enter the single letter or single word the search text not filterd the app is crashed)I enter the single letter or word the Logcat display the error(FATAL EXCEPTION: AsyncTask #1
Process: com.example.myapplication, PID: 8210
java.lang.RuntimeException: java.sql.SQLException: Incorrect syntax near the keyword ‘or’.
at com.example.myapplication.Add$2.run(Add.java:1006)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.sql.SQLException: Incorrect syntax near the keyword ‘or’.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)
at com.example.myapplication.Add$2.run(Add.java:873)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 
at java.lang.Thread.run(Thread.java:1012) ) This is the Code private void ItemDetails(final String barcode) {
String selectedDBName = act.getSelectedItem().toString();
String searchText = searchView.getQuery().toString(); // Declare searchText as final
if (searchText == null || searchText.isEmpty()) {
// Handle empty search text case
return;
}
String[] separated = searchText.split(” “);
searchText = searchText.replace(” “, “%”);