-2

I am trying to create a java program that will lookup a value in a column in a table, and reference a different table to see if the same value is in the table. If they match, I would like to dump the full data from the first table into a new table.

Basically, I have a table of orders defined by a unique order ID. I would like to reference that number to a list of returned orders. If the order was returned, I can then dump the information from the order table to an unsuccessful order table.

I am not sure where to start or if anyone can lead me in the right direction. I am not super java savvy so any input is helpful.

4

1 回答 1

0

您首先将问题分解为更小的步骤,直到您可以对每个步骤进行编码。

程序上。

  • 打开与数据库的连接。

  • 遍历返回的订单列表。

  • 对于每个退回的订单:

    • 从订单表中读取订单。

    • 将订单写入未成功订单表。

  • 提交您的数据库更改。

  • 关闭与数据库的连接。

现在,您认为您可以编写代码,还是需要进一步分解这些步骤?

于 2013-09-04T16:53:02.880 回答