![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY7PQzzcnvAJB1NrvnJQl3QsPqWNVcThRCAmRzVTq5457HDu39i5pxXscoC9unscDDka0kHmCmh7n93URd0ZuAcvZIu4H0bZJUG-azcjxjjRZd8JF_S1DzC5EjsNPCt_TB_r6Bi7EJVmCY/s200/JDBC.jpg)
Query Statement: This code segment creates a Statement object and calls the Statement.executeQuery method to select text from the dba database. The results of the query are returned in a ResultSet object. How to retrieve results from a ResultSet object is explained in Result Sets below.
Statement stmt = con.createStatement(); ResultSet results = stmt.executeQuery("SELECT TEXT FROM dba ");
Update Statement: This code segment creates a Statement object and calls the Statement.executeUpdate method to add an email address to a table in the dba database.
String updateString = "INSERT INTO dba VALUES (some text)"; int count = stmt.executeUpdate(updateString);
0 comments:
Post a Comment