db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lily Wei <lily...@yahoo.com>
Subject Re: Hibernate 3 Outer Join Problem
Date Wed, 28 Jul 2010 05:23:52 GMT
Hi umpirsky:
    I am not sure whether this will solve your problem.
However, will using two parameters work better?

    For example:
            String insertsql = "insert into testdbsize (name, address) values 
            PreparedStatement insertFirst = cs1.prepareStatement(insertsql, 
            String name = new String("ABCD");
            String address  = new String("333 Glory Lily");
            insertFirst.setString(1, name);
            insertFirst.setString(2, address);
            int result = insertFirst.executeUpdate();
            if (result != 0) {
               System.out.println("insert data to testdbsize");
            ResultSet rs = insertFirst.getGeneratedKeys();

            while (rs.next()) {
            System.out.println("The generated key id is: " + rs.getInt(1));


            Also, does it matter if using column tag instead of "column name" 
            For example:
               <id name="id" column="ID">
                       <generator class="increment"/>

Hope this help,

View raw message