Javier,
Is the following line:
> st = conn.createStatement();
on line 67 ? If so, you are not initializing conn before you are using
it. Also if conn is a class variable, then you are going to have threading
problems. It should probably be declared as a local variable in one of
your methods and then passed as a parameter to any other method calls from
there.
Regards,
Richard
At 01:12 PM 11/15/2001 +0100, you wrote:
>This is the method BuscarNoticias that throws the exception
>
>
>public void obtenerNoticias(String idioma) {
> Statement st;
> st=null;
> ResultSet rs;
> rs=null;
> try {
> st = conn.createStatement();
> rs = st.executeQuery("SELECT EROSKI_NOTICIAS.cod_noticia, " +
> "EROSKI_NOTICIAS.titulo, " +
> "EROSKI_NOTICIAS.entradilla, " +
> "EROSKI_NOTICIAS.texto, " +
> "EROSKI_NOTICIAS.fecha, " +
> "EROSKI_NOTICIAS.tituloeus, " +
> "EROSKI_NOTICIAS.entradillaeus, " +
> "EROSKI_NOTICIAS.textocat, " +
> "EROSKI_NOTICIAS.titulogal, " +
> "EROSKI_NOTICIAS.entradillagal, " +
> "EROSKI_NOTICIAS.textogal, " +
> "EROSKI_NOTICIAS.titulocat, " +
> "EROSKI_NOTICIAS.entradillacat, " +
> "EROSKI_NOTICIAS.textocat, " +
> "EROSKI_NOTICIAS.tituloval, " +
> "EROSKI_NOTICIAS.entradillaval, " +
> "EROSKI_NOTICIAS.textoval, " +
> "EROSKI_NOTICIAS.tituloval, " +
> "EROSKI_NOTICIAS.entradillaval, " +
> "EROSKI_NOTICIAS.textoval, " +
> "EROSKI_NOTICIAS.tituloing, " +
> "EROSKI_NOTICIAS.entradillaing, " +
> "EROSKI_NOTICIAS.textoing, " +
> "EROSKI_NOTICIAS.destacado, " +
> "EROSKI_NOTICIAS.mes, " +
> "EROSKI_NOTICIAS.anyo, " +
> "EROSKI_NOTICIAS.fechanoticia, " +
> // "EROSKI_NOTICIAS.negocio, "+
> //Todav�a no hay columna negocio.
> "FROM EROSKI_NOTICIAS ORDER BY fechanoticia");
> //vectorNoticias = new Vector();
> while (rs.next()) {
> Noticias temp = new Noticias();
> temp=null;
> temp.setCod_noticia(rs.getFloat("cod_noticias"));
> temp.setDestacado(rs.getString("destacado"));
> temp.setEntradilla(rs.getString("entradilla"));
> temp.setEntradillaCat(rs.getString("entradillacat"));
> temp.setEntradillaEus(rs.getString("entradillaeus"));
> temp.setEntradillaGal(rs.getString("entradillagal"));
> temp.setEntradillaIng(rs.getString("entradillaing"));
> temp.setEntradillaVal(rs.getString("entradillaval"));
> temp.setFecha(rs.getString("fecha"));
> // temp.setNegocio(rs.getString("negocio"));
> // Todav�a no tenemos columna negocio
> temp.setTexto(rs.getString("texto"));
> temp.setTextoCat(rs.getString("textocat"));
> temp.setTextoEus(rs.getString("textoeus"));
> temp.setTextoGal(rs.getString("textogal"));
> temp.setTextoVal(rs.getString("textoval"));
> temp.setTitulo(rs.getString("titulo"));
> temp.setTituloCat(rs.getString("titulocat"));
> temp.setTituloEus(rs.getString("tituloeus"));
> temp.setTituloGal(rs.getString("titulogal"));
> temp.setTituloIng(rs.getString("tituloing"));
> temp.setTituloVal(rs.getString("tituloval"));
> temp.setAnyo(rs.getString("anyo"));
> temp.setMes(rs.getString("mes"));
> //Ahora a�ado todo al vector
> vectorNoticias.addElement(temp);
> }
> } catch (SQLException sql) {
> System.out.println("Se ha producido un error SQL");
> System.out.println(sql.getMessage());
> } finally {
> if (st != null) {
> try {
> st.close();
> } catch (SQLException e) {
> System.out.println("Se ha producido un error al cerrar la conexion");
> System.out.println(e.getMessage());
> }
> }
> }
>}
>
>
> Javier
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html