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
programa | |
{ | |
inclua biblioteca Util | |
funcao inicio() | |
{ | |
inteiro lista[30] | |
inteiro num_elementos = Util.numero_elementos(lista) |
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
insert into Veiculo (codigo, fabricante, modelo, anoFabricacao, anoModelo, valor) | |
values (1, 'Fiat', 'Toro', 2020, 2020, 107000); | |
insert into Veiculo (codigo, fabricante, modelo, anoFabricacao, anoModelo, valor) | |
values (2, 'Ford', 'Fiesta', 2019, 2019, 42000); | |
insert into Veiculo (codigo, fabricante, modelo, anoFabricacao, anoModelo, valor) | |
values (3, 'Renault', 'Clio', 2013, 2013, 20000); |
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
package br.edu.ifpr.persistproject.repository; | |
import br.edu.ifpr.persistproject.connection.ConnectionFactory; | |
import br.edu.ifpr.persistproject.exception.DatabaseIntegrityException; | |
import br.edu.ifpr.persistproject.model.Seller; | |
import java.sql.*; | |
import java.text.SimpleDateFormat; | |
public class SellerRepository { |
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
package br.edu.ifpr.persistproject.repository; | |
import br.edu.ifpr.persistproject.connection.ConnectionFactory; | |
import br.edu.ifpr.persistproject.model.Seller; | |
import java.sql.*; | |
import java.text.SimpleDateFormat; | |
public class SellerRepository { |
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
public class SellerRepository { | |
private Connection conn; | |
private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); | |
public SellerRepository(){ | |
ConnectionFactory connectionFactory = new ConnectionFactory(); | |
conn = connectionFactory.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
public class SellerRepository { | |
private Connection conn; | |
private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); | |
public SellerRepository(){ | |
ConnectionFactory connectionFactory = new ConnectionFactory(); | |
conn = connectionFactory.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
public class SellerRepository { | |
private Connection conn; | |
public SellerRepository(){ | |
ConnectionFactory connectionFactory = new ConnectionFactory(); | |
conn = connectionFactory.getConnection(); | |
} | |
public List<Seller> getSellers(){ |
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
public class Seller { | |
private String Id; | |
private String name; | |
private String email; | |
private LocalDate birthDate; | |
private Double BaseSalary; | |
//private Department department; | |
public String getId() { |
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
public class ConnectionFactory { | |
public Connection getConnection(){ | |
String database = ""; | |
String user = ""; | |
String pass = "" | |
try { | |
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
CREATE TABLE department ( | |
Id int(11) NOT NULL AUTO_INCREMENT, | |
Name varchar(60) DEFAULT NULL, | |
PRIMARY KEY (Id) | |
); | |
CREATE TABLE seller ( | |
Id int(11) NOT NULL AUTO_INCREMENT, | |
Name varchar(60) NOT NULL, | |
Email varchar(100) NOT NULL, |