Subject | Re: [Firebird-Java] Problems with PreparedStament... |
---|---|
Author | Rick Fincher |
Post date | 2004-01-06T17:20:57Z |
Hi Allysson,
I'm not quite sure what this line does:
NOVO_DIRETORIA = CONEXAO.CONEXAO().prepareStatement(SQL);
but assuming CONEXAO is a java.sql.Connection, this should be:
NOVO_DIRETORIA = CONEXAO.prepareStatement(SQL);
You get the Connection from JayBird with a statement like:
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection CONEXAO=
DriverManager.getConnection("jdbc:firebirdsql:localhost/3050:/firebird/test.
gdb", "sysdba", "masterkey");
Hope this helps,
Rick
I'm not quite sure what this line does:
NOVO_DIRETORIA = CONEXAO.CONEXAO().prepareStatement(SQL);
but assuming CONEXAO is a java.sql.Connection, this should be:
NOVO_DIRETORIA = CONEXAO.prepareStatement(SQL);
You get the Connection from JayBird with a statement like:
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection CONEXAO=
DriverManager.getConnection("jdbc:firebirdsql:localhost/3050:/firebird/test.
gdb", "sysdba", "masterkey");
Hope this helps,
Rick
----- Original Message -----
> 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
>