Olá Pessoal
Estou fazendo um programinha de inserção no banco de dados. Desenvolvi aqui duas classes, a CONTATOS e a CONTATOSDAO.
Quando compilei a segunda classe, ainda nao terminada, gerou um código, apontando erro para o método ConnectionFactory().
Segue o código:
import java.util.Calendar;
public class Contato {
private long id;
private String nome;
private String email;
private String endereco;
private Calendar dataNascimento;
public Contato(long id, String nome, String email, String endereco,
Calendar dataNascimento){
this.id = id;
this.nome = nome;
this.email = email;
this.endereco = endereco;
this.dataNascimento = dataNascimento;
}
public void setDataNascimento(Calendar dataNascimento) {
this.dataNascimento = dataNascimento;
}
public void setEmail(String email) {
this.email = email;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
public void setId(long id) {
this.id = id;
}
public void setNome(String nome) {
this.nome = nome;
}
public Calendar getDataNascimento() {
return dataNascimento;
}
public String getEmail() {
return email;
}
public String getEndereco() {
return endereco;
}
public long getId() {
return id;
}
public String getNome() {
return nome;
}
}
import java.sql.Connection;
public class ContatoDAO {
//A conexão com o banco de dados
private Connection connection;
public ContatoDAO(){
this.connection = new ConnectionFactory().getConnection();
}
}
Segue o erro apontado pelo compilador
C:\Documents and Settings\Thiago de P. Beserra\Desktop\BancoDados\src\ContatoDAO.java:11: cannot find symbol
symbol : class ConnectionFactory
location: class ContatoDAO
this.connection = new ConnectionFactory().getConnection();
1 error
C:\Documents and Settings\Thiago de P. Beserra\Desktop\BancoDados\nbproject\build-impl.xml:438: The following error occurred while executing this line:
C:\Documents and Settings\Thiago de P. Beserra\Desktop\BancoDados\nbproject\build-impl.xml:224: Compile failed; see the compiler error output for details.
FALHA NA CONSTRUÇÃO (tempo total: 0 segundos)
Se possível, quero a ajuda dos amigos do fórum para me ajudar a resolver o erro.
GRATO