Installation guide
39
DataOutputStream dos = new DataOutputStream(response.getOutputStream());
dos.writeUTF("Succeed");
try
{
connect = conndb.getConn();
Statement stmt = connect.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
stmt.executeUpdate(updateSQL);
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
ConnDB.releaseConnection(connect);
}
}
}
Appendix-5
package com.demo.mobile;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnDB
{
private Connection connection = null;
public Connection getConn()
{
try
{
Class.forName("org.postgresql.Driver").newInstance();
String url = "jdbc:postgresql://localhost:5432/postgres" ;
connection = DriverManager.getConnection(url, "postgres" , "postgres" );
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
}
return connection;
}