If you run a select query where the number of columns and their data types are unknown, you may extract the number of attributes, their data types, etc from the populated result-set.
This technique is very important to understand when you are writing code to generate a dynamic view for an application.
1
2
3
4
5
6
7
8
9
10
package com.t4b.jdbc.mysql.test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.