Dim ConnectionStr As string = "database=InvertedSoftware;server= InvertedSoftware"
Dim objConnection As SqlConnection = new SqlConnection(ConnectionStr)
Dim categoryDataAdapter As SqlDataAdapter = new SqlDataAdapter()
categoryDataAdapter.TableMappings.Add("Table", "Category")
objConnection.Open()
Dim objCommand As SqlCommand = new SqlCommand("SELECT * FROM tbl_category", objConnection)
objCommand.CommandType = CommandType.Text
categoryDataAdapter.SelectCommand = objCommand
Dim objDataSet As DataSet = New DataSet("Inventory")
categoryDataAdapter.Fill(objDataSet)
Asked
Active
Viewed 1,707 times
0

Alexandre Santos
- 8,170
- 10
- 42
- 64

ram
- 29
- 10
-
Check http://stackoverflow.com/questions/1340283/datatable-equivalent-in-java – oardic Sep 13 '14 at 09:37
-
possible duplicate of [DataSet class in Java?](http://stackoverflow.com/questions/1194971/dataset-class-in-java) – Mark Rotteveel Sep 13 '14 at 09:52
1 Answers
0
There is no exact equivalent of a DataTable
in JDBC. The closest thing is probably the CachedRowSet
.

Mark Rotteveel
- 100,966
- 191
- 140
- 197
-
but when i tried CachedRowset, there is SQLException in insertRow() method. Failed to insert row. what is the reason why it's failed to insert new row in CachedRowset? (not yet call acceptchanges() method) – ram Sep 13 '14 at 10:00
-
@ram That is impossible to answer. I suggest you post a new question with code to reproduce and the full error message and stacktrace. In most cases you need to configure the `CachedRowSet` so it is able to persist. – Mark Rotteveel Sep 13 '14 at 10:01
-
http://stackoverflow.com/questions/25819496/java-cachedrowset-failed-to-insert-row -- this is my previous post, thanks in advance @Mark Rotteveel – ram Sep 13 '14 at 10:10