JDBC (Java DataBase Connectivity) is the base API which enables interacting with SQL database servers by executing SQL statements using the Java programming language.
-1
votes
0answers
18 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 ...
2
votes
1answer
29 views
Am I using appropiate methods. Login System
I have had to do a crash course in JSP, Servlets, and JDBC. I decided to attempt a Login System. I'm unsure if my use of try/catch is appropriate and if I am closing database connections correctly. ...
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?
...
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 ...
4
votes
3answers
822 views
Connection pool in Java
Please review this connection pool. I tested it and it works but can we improve it from design or performance perspective?
public class ConnectionPool {
private static final int MAX_SIZE=10;
...
4
votes
1answer
4k views
Is there a better way to paginate large SQL-Results?
It feels like pagination is one of the most discussed questions on the web, which always ends up with some quick&dirty hacks on how to paginate. I want to paginate a large result set from an SQL ...
3
votes
4answers
603 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, ...