Eclipse Mobile Mousw Guide d'installation Page 39

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 59
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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;
}
Vue de la page 38
1 2 ... 34 35 36 37 38 39 40 41 42 43 44 ... 58 59

Commentaires sur ces manuels

Pas de commentaire