hi,
Im just wondering on how I could get a columns and a record count I mean the whole thing in a database aside from executing this statement "select count(*) from myDatabase"
...is there another statement that i can use instead of this one coz it doesnt retrieve any columns just the record count...thanks
choybutchoy
0
Newbie Poster
Recommended Answers
Jump to PostRead the Javadocs of the classes
ResultSetMetaData
andDatabaseMetaData
for more details regarding your database/table etc. A simple web search for these classes might give you sample snippets on how to go about using them.
Jump to PostFirst this could be helpful:
select count(*), col_1, col_2 from myDatabase
Each "row" of the ResultSet will have the row count as well as the columns.
Also you can run 2 queries.
The first that will get you the row count
The second that will get …
All 7 Replies
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
choybutchoy
0
Newbie Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
choybutchoy
0
Newbie Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
choybutchoy
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.