Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Collections;
- import java.util.ArrayList;
- import java.sql.DriverManager;
- import java.sql.Connection;
- import java.sql.SQLException;
- import java.util.Date;
- import java.math.*;
- class Customer
- {
- private int id;
- private String firstname;
- private String lastname;
- private String address1;
- private String address2;
- private String city;
- private String state;
- private int zip;
- private String country;
- private short region;
- private String email;
- private String phone;
- private String creditCardType;
- private String creditCard;
- private String creditCardExpiration;
- private String username;
- private String password;
- private short age;
- private int income;
- private char gender;
- public int getId() { return this.id; }
- public void setId(int value) { this.id = value; }
- public String getFirstname() { return this.firstname; }
- public void setFirstname(String value) { this.firstname = value; }
- public String getLastname() { return this.lastname; }
- public void setLastname(String value) { this.lastname = value; }
- public String getAddress1() { return this.address1; }
- public void setAddress1(String value) { this.address1 = value; }
- public String getAddress2() { return this.address2; }
- public void setAddress2(String value) { this.address2 = value; }
- public String getCity() { return this.city; }
- public void setCity(String value) { this.city = value; }
- public String getState() { return this.state; }
- public void setState(String value) { this.state = value; }
- public int getZip() { return this.zip; }
- public void setZip(int value) { this.zip = value; }
- public String getCountry() { return this.country; }
- public void setCountry(String value) { this.country = value; }
- public short getRegion() { return this.region; }
- public void setRegion(short value) { this.region = value; }
- public String getEmail() { return this.email; }
- public void setEmail(String value) { this.email = value; }
- public String getPhone() { return this.phone; }
- public void setPhone(String value) { this.phone = value; }
- public String getCreditCardType() { return this.creditCardType; }
- public void setCreditCardType(String value) { this.creditCardType = value; }
- public String getCreditCard() { return this.creditCard; }
- public void setCreditCard(String value) { this.creditCard = value; }
- public String getCreditCardExpiration() { return this.creditCardExpiration; }
- public void setCreditCardExpiration(String value) { this.creditCardExpiration = value; }
- public String getUsername() { return this.username; }
- public void setUsername(String value) { this.username = value; }
- public String getPassword() { return this.password; }
- public void setPassword(String value) { this.password = value; }
- public short getAge() { return this.age; }
- public void setAge(short value) { this.age = value; }
- public int getIncome() { return this.income; }
- public void setIncome(int value) { this.income = value; }
- public char getGender() { return this.gender; }
- public void setGender(char value) { this.gender = value; }
- public Customer()
- {
- }
- public Customer(int id, String firstname, String lastname, String address1, String address2,
- String city, String state, int zip, String country, short region, String email,
- String phone, String creditCardType, String creditCard, String creditCardExpiration,
- String username, String password, short age, int income, char gender)
- {
- this.id = id;
- this.firstname = firstname;
- this.lastname = lastname;
- this.address1 = address1;
- this.address2 = address2;
- this.city = city;
- this.state = state;
- this.zip = zip;
- this.country = country;
- this.region = region;
- this.email = email;
- this.phone = phone;
- this.creditCardType = creditCardType;
- this.creditCard = creditCard;
- this.creditCardExpiration = creditCardExpiration;
- this.username = username;
- this.password = password;
- this.age = age;
- this.income = income;
- this.gender = gender;
- }
- }
- class Order
- {
- private int id;
- private Date orderDate;
- private int customerId;
- private BigDecimal netAmount;
- private BigDecimal tax;
- private BigDecimal totalAmount;
- public int getId() { return this.id; }
- public void setId(int value) { this.id = value; }
- public Date getOrderDate() { return this.orderDate; }
- public void setOrderDate(Date value) { this.orderDate = value; }
- public int getCustomerId() { return this.customerId; }
- public void setCustomerId(int value) { this.customerId = value; }
- public BigDecimal getNetAmount() { return this.netAmount; }
- public void setNetAmount(BigDecimal value) { this.netAmount = value; }
- public BigDecimal getTax() { return this.tax; }
- public void setTax(BigDecimal value) { this.tax = value; }
- public BigDecimal getTotalAmount() { return this.totalAmount; }
- public void setTotalAmount(BigDecimal value) { this.totalAmount = value; }
- public Order()
- {
- }
- public Order(int id, Date orderDate, int customerId, BigDecimal netAmount, BigDecimal tax, BigDecimal totalAmount)
- {
- this.id = id;
- this.orderDate = orderDate;
- this.customerId = customerId;
- this.netAmount = netAmount;
- this.tax = tax;
- this.totalAmount = totalAmount;
- }
- }
- class OrderLine
- {
- private int id;
- private int orderId;
- private int prodId;
- private int quantity;
- private Date orderDate;
- public int getId() { return this.id; }
- public void setId(int value) { this.id = value; }
- public int getOrderId() { return this.orderId; }
- public void setOrderId(int value) { this.orderId = value; }
- public int getProdId() { return this.prodId; }
- public void setProdId(int value) { this.prodId = value; }
- public int getQuantity() { return this.quantity; }
- public void setQuantity(int value) { this.quantity = value; }
- public Date getOrderDate() { return this.orderDate; }
- public void setOrderDate(Date value) { this.orderDate = value; }
- public OrderLine()
- {
- }
- public OrderLine(int id, int orderId, int prodId, int quantity, Date orderDate)
- {
- this.id = id;
- this.orderId = orderId;
- this.prodId = prodId;
- this.quantity = quantity;
- this.orderDate = orderDate;
- }
- }
- // The classic Hello World program!
- class Test {
- public ArrayList<Order> f1()
- {
- String url = "jdbc:postgresql://localhost/performance?user=performancetest&password=performancetest&ssl=true";
- Connection c = null;
- try {
- c = DriverManager.getConnection(url);
- ArrayList<Order> list = new ArrayList<Order>();
- return list;
- }
- catch (SQLException se)
- {
- throw se;
- }
- finally
- {
- }
- }
- public static void main(String[] args) {
- //Write Hello World to the terminal window
- System.out.println("Hello World!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement