JDBC Questions et reponses d'entretien
Question : What’s the difference between TYPE_SCROLL_INSENSITIVE , and TYPE_SCROLL_SENSITIVE?Reponse : You will get a scrollable ResultSet object if you specify one of these ResultSet constants.The difference between the two has to do with whether a result set reflects changes that are made to it while it is open and whether certain methods can be called to detect these changes. Generally speaking, a result set that is TYPE_SCROLL_INSENSITIVE does not reflect changes made while it is still open and one that is TYPE_SCROLL_SENSITIVE does. All three types of result sets will make changes visible if they are closed and then reopened:Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); ResultSet srs = stmt.executeQuery("SELECT EMP_NAME, SAL FROM EMPLOYEE"); srs.afterLast(); while (srs.previous()) { String name = srs.getString("EMP_NAME"); float sal = srs.getFloat("SAL"); System.out.println(name + " " + sal); } |
Enregistrer pour revision
Ajoutez cet element aux favoris, marquez-le comme difficile ou placez-le dans un ensemble de revision.
Connectez-vous pour enregistrer des favoris, des questions difficiles et des ensembles de revision.
Est-ce utile ? Oui Non
Les plus utiles selon les utilisateurs :
- What is JDBC? Describe the steps needed to execute a SQL query using JDBC.
- What are the steps involved in establishing a JDBC connection?
- Is JDBC-ODBC bridge multi-threaded?
- Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?
- What are the different driver types available in JDBC?