Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

get columns number sql

//With JAVA

String quer="SELECT * FROM sample2 where 1=2";

Statement st=con.createStatement();
ResultSet rs=st.executeQuery(quer);
ResultSetMetaData rsmd = rs.getMetaData();
int NumOfCol=0;
NumOfCol=rsmd.getColumnCount();
System.out.println("Query Executed!! No of Colm="+NumOfCol);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #columns #number #sql
ADD COMMENT
Topic
Name
7+6 =