Hi, the code looks ok to me. If you're experiencing "hangs" on update or insert statements with whatever client make sure your database logs aren't full. It seems to be a typical SAPDB behaviour to wait for enough transaction log space to be available when commiting data, this causes the client to "hang" (it will continue to run once theres log freed online).
This is especially a problem with rather tiny databases and very little log space (just a few MB for example). Keep an eye out for your log space if you have transaction logging switched on. If you don't need it set the databases logmode to "DEMO". Hope this helps, Watz "Andrius Vilciauskas" <[EMAIL PROTECTED]> schrieb im Newsbeitrag asfjgo$6oc$[EMAIL PROTECTED]">news:asfjgo$6oc$[EMAIL PROTECTED]... > 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 > _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
