-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d494764
commit c9cdef6
Showing
4 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 4,16 @@ | |
import model.dao.SellerDao; | ||
import model.entities.Seller; | ||
|
||
import java.util.Date; | ||
|
||
public class Program { | ||
|
||
public static void main(String[] args) { | ||
|
||
Seller seller = new Seller(21, "Bob", "[email protected]", new Date(), 3000.0, obj); | ||
|
||
SellerDao sellerDao = DaoFactory.createSellerDao(); | ||
SellerDao sellerDao = DaoFactory.createSellerDao(); | ||
Seller seller = sellerDao.findById(3); | ||
System.out.println(seller); | ||
|
||
System.out.println(seller); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 1,11 @@ | ||
package model.dao; | ||
|
||
import db.Db; | ||
import model.impl.SellerDaoJDBC; | ||
|
||
public class DaoFactory { | ||
|
||
public static SellerDao createSellerDao(){ | ||
return new SellerDaoJDBC(); | ||
return new SellerDaoJDBC(Db.getConnection()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters