5
votes
1answer
294 views

Android database interaction logic

I have a database-intensive app. Almost every activity requires access to the database, both reading and writing. I had a lot of problems with separate threads and activities on the stack closing ...
3
votes
4answers
606 views

Accessing the only element of Java ResultSet

Does this code look OK? public Map<String, String> getById(long id) { String sql = "select * from " + this._TABLE_NAME + " where id = ?"; PreparedStatement p; Map<String, ...
3
votes
1answer
155 views

Execute multiple query from a text file

I am just wondering if this is a correct way to execute multiple query from a text file. Connection conn = Utility.getConnection(); Statement stmt = null; try{ JFileChooser chooser = new ...
2
votes
1answer
87 views

SQL PreparedStatement; Am I doing it right?

I am building a web app with a single (not pooled) full time (jdbc) connection between static classes and the database. This is expected to be a low traffic site and the static methods are ...
2
votes
1answer
376 views

Android SQL in its simplest form

I thought I would just post a really simple wrapper for those who don't want to implement the retarded SqliteOpenHelper, which is really, really stupid. Below is a class to open/create a database, ...
1
vote
2answers
188 views

How to optimize this SQL delete

I want to optimize the performance of this SQL query. If I populate this hashtable with one million keys the query will take around minute. How I can optimize this Java method for faster execution? ...
1
vote
2answers
76 views

How to optimize this code?

So I have this piece of code in Java(Android) to add a list of brokers to a local SQLite database as one single sql instruction. public void Add(List<Broker> brokers) { if(brokers == null ...
-1
votes
0answers
19 views

Servlets is not able to insert rows in databse [on hold]

hi am trying to insert values into SQL database using jdbc. Current code able to connect and query sql DB. am using executeupdate to insert the values .this code is not giving any errors.but values ...