简体   繁体   中英

what is the equivalent of ado.net datatable in java?

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)

There is no exact equivalent of a DataTable in JDBC. The closest thing is probably the CachedRowSet .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM