Hello,

I'm not very experienced in sapdb and java. I need explainaition why my code
hangs pc. Thanks in advance .
Three classes:

public class Database {
 Connection connection;
 public Database() {
  try {
   Class.forName("com.sap.dbtech.jdbc.DriverSapDB");//
  } catch (ClassNotFoundException e) {};
  try{
  connection = java.sql.DriverManager.getConnection ("jdbc:sapdb://" +
"andriusxp" + "/" + "erp_dev",
               "dba", "dba");
  } catch (SQLException e){
   System.out.println(e.getMessage());
  };
 }
 public Connection getConnection() {
  return connection;
 }

}

public class TableA {
 Connection con;

 public void setConnection(Connection conn) {
  con = conn;
 }

 public void update() {
  try {
  Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,

ResultSet.CONCUR_UPDATABLE);
  ResultSet rs = stmt.executeQuery("select * from erp_partners");
  rs.next();
  String hello = rs.getString(2);

  rs.updateString(2, "AA"); // PROBLEM IS HERE
  rs.updateRow();
  System.out.println(hello);
  }catch (SQLException e) {
   System.out.println(e.getMessage());
  }

 }

}


public class Main {

 public Main() {
  Database db = new Database();
  Connection conn = db.getConnection();
  TableA a = new TableA();
  a.setConnection(conn);
  a.update();
  System.out.println("End");
 }

 public static void main(String[] args) {
  Main main = new Main();
 }
}





_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to