-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilmReview.java
More file actions
43 lines (33 loc) · 979 Bytes
/
FilmReview.java
File metadata and controls
43 lines (33 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.time.LocalDate;
public class FilmReview extends Review {
public Date date;
public Connection myConn;
// Constructors
// Default Constructor
public FilmReview() throws SQLException {
this.date = calculateDate();
this.myConn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:8889/MovieCrtique", "kculbreth36",
"Gerder11");
}
// Partial Constructor
public FilmReview(Connection myConn) {
this.date = calculateDate();
this.myConn = myConn;
}
// Full Constructor
public FilmReview(Connection myConn, Date date) {
this.date = date;
this.myConn = myConn;
}
// Method using the sql type of date to assign the current date to variable
// "date"
public Date calculateDate() {
LocalDate date1 = java.time.LocalDate.now();
Date date = Date.valueOf(date1);
return date;
}
}