table « Resultset « Java Database Q&A

1. How can I get the column name of the primary key of a Database Table from the ResultSet or ResultSetMetaData object in JAVA?

I am writing a Java Application. I have got a ResultSet. Now I want to find out the coloumn name of the primary key of the table. Is it possible to get ...

2. Can I get a table name from a join select resultset metadata

Below is my code trying to retrieve table name form Resultset

ResultSet rs = stmt.executeQuery("select * from product");

ResultSetMetaData meta = rs.getMetaData();
int count = meta.getColumnCount();
for (int i=0; i<count; i++) {
But it ...

3. General purpose Table structure in Java (like ResultSet)

Does anyone know if there's a good general-purpose Table-based structure that I can use for manipulating data? ResultSet is an interface, so am I stuck having to fully implement something ...

4. How can I identify columns when SELECTing from multiple tables with JDBC?

I have two tables that I join on the id-column, they look like:

| users |
| id | name |

| posts |
| id | user_id | message |
And now I want to ...

5. Temporary tables using JDBC with null ResultSet

I am executing a stored procedure via standard JDBC Connection using MS SQL Driver version 3.0. I have found that when I create and insert data into a temporary table the stored ...

6. Manipulating a resultSet for multiple inputs on a table

I have worked with this a couple of times, and got it to work using an Array, but I wanted to try it in a different way. Basically I have ...

8. Create a table using ResultSet ???

11. How to pretty print ResultSet in a text table

Hi folks, I have an application which executes SQL statements on different databases and I want to send the returned results via email. Everything works fine so far and my only "problem" is how I can transform the returned ResultSets to nice looking text tables which I can include into the emails. Of course this is not a very hard task ...

12. Resultset to HTML Table

Could be done in many ways. But you should explain what you exactly want to do this, how, where you going to display it and so on... You can create a string with concatenating all the required html tags to in to string. But you have to display the text in HTML support control, like a label and so on.

14. Table formatting of output from resultset

Hi, I have been working on an application which produces html pages and excel spreadsheets from queries from a relational database. I am new to Java and am not aware of all the tools and tricks to optimize the code, so I have constructed a very simple formatter to wrap the results of the resultset in HTML tags. The code works ...

15. putting java Query Resultset data into a .NET like data table

First there is a JDBC forum. Secondly I am guessing that you are looking for javax.sql.RowSet. I have no idea how they work (and I am not confident that they are a good idea in anything except small apps.) Third, in no way shape or form is the .Net database stuff database independent if that is what you were suggesting.

16. ResultSet Data into a table

So is the problem: a) the SQL (ie, the ResultSet is empty) If this is the problem then you question should be posted in the SQL forum. b) adding the data to the TableModel (ie. TableModel is empty) If this is the problem then your question should be posted in the Swing forum. We have no idea what the problem might ...