Skip to content

Commit 5970444

Browse files
authored
Create ShowData.java
1 parent b364fc6 commit 5970444

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

jdbc/ShowData.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import java.sql.*;
2+
import java.util.*;
3+
class ShowData{
4+
/**
5+
* File 3/4 of jdbc series
6+
* Call this class to show data of sql table
7+
*/
8+
9+
public static void main(String args[]){
10+
11+
ShowData s = new ShowData();
12+
13+
JdbcHelper jh = new JdbcHelper();
14+
15+
jh.getStatement();
16+
17+
ArrayList<Product> pro = jh.getProducts();
18+
19+
System.out.println(pro.size());
20+
21+
for(Product p1:pro){
22+
23+
System.out.println("name is "+ p1.getName() + " price is " +p1.getPrice());
24+
25+
}
26+
}
27+
28+
29+
}

0 commit comments

Comments
 (0)