Using the ResultSet Object 83 (Flash web hosting) methods, the outcome

Using the ResultSet Object 83 methods, the outcome is a Boolean value. Consider a table defined as mysql> describe bool; +——-+————+——+—–+———+——-+ | Field | Type | Null | Key | Default | Extra | +——-+————+——+—–+———+——-+ | id | int(11) | YES | | NULL | | | a | tinyint(1) | YES | | NULL | | | b | int(11) | YES | | NULL | | | c | varchar(4) | YES | | NULL | | | d | varchar(5) | YES | | NULL | | +——-+————+——+—–+———+——-+ 5 rows in set (0.00 sec) Now see what happens if we put the following data into the table: mysql> select * from bool; +——+——+——+——+——+ | id | a | b | c | d | +——+——+——+——+——+ | 1 | 1 | 0 | true | f | +——+——+——+——+——+ 1 row in set (0.00 sec) The data can be pulled with the following Java code: ResultSet rs = statement.executeQuery( “SELECT * FROM bool”); while (rs.next()) { System.out.println(rs.getString(”a”) + ” ” + rs.getBoolean(”a”)); System.out.println(rs.getString(”b”) + ” ” + rs.getBoolean(”b”)); System.out.println(rs.getString(”c”) + ” ” + r rs.getBoolean(”c”)); System.out.println(rs.getString(”d”) + ” ” + rs.getBoolean(”d”)); } Can you guess the output? Here it is: 1 true 0 false true true f false As you can see, the values within the columns are properly translated into Boolean values. Byte If the information in your database needs to be obtained as a raw byte or series of bytes, then the following four methods will be helpful to you:
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services

Comments are closed.