Eclipse Mobile Mousw Przewodnik Instalacji Strona 39

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 59
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 38
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;
}
Przeglądanie stron 38
1 2 ... 34 35 36 37 38 39 40 41 42 43 44 ... 58 59

Komentarze do niniejszej Instrukcji

Brak uwag