Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to find total column from a resultset?

Answers were Sorted based on User's Feedback



How to find total column from a resultset?..

Answer / manik chand

resultSet.getMetaData().getColumnCount().

Is This Answer Correct ?    8 Yes 0 No

How to find total column from a resultset?..

Answer / shankar

int columnCnt = java.sql.ResultSetMetaData.getColumnCount();

Is This Answer Correct ?    7 Yes 1 No

How to find total column from a resultset?..

Answer / rajshri

import java.sql.*;

class columncount
{
public static void main(String[]args)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection
("jdbc:odbc:mydsnname");
Statement st=con.createStatement();
String sql="select * from table_name";

ResultSet rs=st.executeQuery(sql);
ResultSetMetaData rd=rs.getMetaData();
int k=rd.getColumnCount();
System.out.println("no of count is " +k);
}
catch(SQLException e1)
{
System.out.println("not working");
}

Is This Answer Correct ?    5 Yes 0 No

How to find total column from a resultset?..

Answer / tathagata

First one is the correct ans.2nd & 3rd will be return
toatal no rows not column.

Is This Answer Correct ?    0 Yes 1 No

How to find total column from a resultset?..

Answer / thiyagu

rs.getRow();

Is This Answer Correct ?    1 Yes 6 No

How to find total column from a resultset?..

Answer / ramu

while(rs.next())
{
getInt(1);
}

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More JDBC Interview Questions

Where jdbc drivermanager class is used?

0 Answers  


What are the flow statements of jdbc?

0 Answers  


What are the methods which can verify the cursor particular position?

0 Answers  


What is CLOB and BLOB datatypes in JDBC?

0 Answers  


What is the difference between ojdbc6 and ojdbc7?

0 Answers  


How do you determine the sensitivity of the ResultSet object?

0 Answers  


what are the advantages of JDBC?

7 Answers  


What is jsp and jdbc?

0 Answers  


What is the meaning of “dirty read” in the database?

0 Answers  


What is the use of setFetchSize() and setMaxRows() methods in Statement?

0 Answers  


How to find number of records in result set?

2 Answers  


What does jdbc do?

0 Answers  


Categories