Subject | Problems with PreparedStament... |
---|---|
Author | Allysson Costa |
Post date | 2004-01-06T13:39:22Z |
Hello friends,
I trying to execute a prepared stament but it result
in an unknow error:
"java.lang.NullPointerException"
I have using:
-----------------------------------------------------
import java.sql.*;
PreparedStatement NOVO_DIRETORIA;
String SQL = null;
try
{
SQL = "SELECT DI_CODIGO FROM NOVO_DI_CODIGO";
NOVO_DIRETORIA =
CONEXAO.CONEXAO().prepareStatement(SQL);
}
-----------------------------------------------------
Until here is fine. But when I try to execute the
code:
-----------------------------------------------------
try
{
ResultSet DIRETORIA1;
DIRETORIA1 = NOVO_DIRETORIA.executeQuery();
}
-----------------------------------------------------
Then the error appears.
I don't know how to solve this problem.
Any help.
Thanks.
Allysson
______________________________________________________________________
Conheça a nova central de informações anti-spam do Yahoo! Mail:
http://www.yahoo.com.br/antispam
I trying to execute a prepared stament but it result
in an unknow error:
"java.lang.NullPointerException"
I have using:
-----------------------------------------------------
import java.sql.*;
PreparedStatement NOVO_DIRETORIA;
String SQL = null;
try
{
SQL = "SELECT DI_CODIGO FROM NOVO_DI_CODIGO";
NOVO_DIRETORIA =
CONEXAO.CONEXAO().prepareStatement(SQL);
}
-----------------------------------------------------
Until here is fine. But when I try to execute the
code:
-----------------------------------------------------
try
{
ResultSet DIRETORIA1;
DIRETORIA1 = NOVO_DIRETORIA.executeQuery();
}
-----------------------------------------------------
Then the error appears.
I don't know how to solve this problem.
Any help.
Thanks.
Allysson
______________________________________________________________________
Conheça a nova central de informações anti-spam do Yahoo! Mail:
http://www.yahoo.com.br/antispam