at.glawar
GlawarDataAdapter [2006-07-04]

Package at.glawar.gladataadapter

Provides classes and methods to deal with database connection.

See:
          Description

Class Summary
GLAFirebirdDataAdapter Provides methods for creating a database connection to a Firebird database.
GLAMSSQLDataAdapter Provides methods for creating a database connection to a Microsoft's SQL-Server 2000 or 2005.
GLAMySQLDataAdapter Provides methods for creating a database connection to a MySQL database.
GLAOracleDataAdapter Provides methods for creating a database connection to an Oracle database.
 

Package at.glawar.gladataadapter Description

Provides classes and methods to deal with database connection.

For every database exists one database adapter which can be used like follows:
 
GLAOracleDataAdapter dbOracle = null;
 
try {
  dbOracle = new GLAOracleDataAdapter("oracle.company.at", "1521", "db_name", "db_username", "db_password");
  con = dbOracle.getConnection();
  pstmt = con.prepareStatement("select attribut from table where (attribut2 = ?)");
  pstmtpstmtSub.setString(1, "WertName");
  rs = pstmt.executeQuery();
  while (rs.next()) {
    System.out.println(rs.getString(1));
  }
} catch (SQLException ex) {
  GLAException.print(ex);
} finally {
  if (rs != null) {
    try {
      rs.close();
      rs = null;
    } catch (Exception ex_nothing) {}
  }
  if (pstmt != null) {
    try {
      pstmt.close();
      pstmt = null;
    } catch (Exception ex_nothing) {}
  }
  if (con != null) {
    try {
      con.close();
      con = null;
    } catch (Exception ex_nothing) {}
  }
}


software.glawar.at

Developed by software.glawar.at