Skip to content

Instantly share code, notes, and snippets.

@darbyluv2code
Created February 4, 2018 17:13
Show Gist options
  • Select an option

  • Save darbyluv2code/36d2bb7c705e4d93a3f22288b41ee9a7 to your computer and use it in GitHub Desktop.

Select an option

Save darbyluv2code/36d2bb7c705e4d93a3f22288b41ee9a7 to your computer and use it in GitHub Desktop.
Java JDBC Tutorial - Part 12.2: Connect Java Swing GUI to a MySQL Database - Create the DAO
package com.luv2code.jdbc.employeesearch.core;
import java.math.BigDecimal;
/**
*
* @author www.luv2code.com
*
*/
public class Employee {
private int id;
private String lastName;
private String firstName;
private String email;
private BigDecimal salary;
public Employee(int id, String lastName, String firstName, String email,
BigDecimal salary) {
super();
this.id = id;
this.lastName = lastName;
this.firstName = firstName;
this.email = email;
this.salary = salary;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public BigDecimal getSalary() {
return salary;
}
public void setSalary(BigDecimal salary) {
this.salary = salary;
}
@Override
public String toString() {
return String
.format("Employee [id=%s, lastName=%s, firstName=%s, email=%s, salary=%s]",
id, lastName, firstName, email, salary);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment