public static int getid() {

        boolean result = false;
        Connection con = getcon();
        int id = -10;
        try {
            String stusql = "select max(id) as bid from testtable ";
            PreparedStatement stmt = null;
            stmt = con.prepareStatement(stusql);

            ResultSet rs = stmt.executeQuery();
            if (rs.next()) {
                id = rs.getInt("bid");
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            try {
                con.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return id;


    }