ayuda con un error
Publicado por marta (6 intervenciones) el 05/09/2007 12:18:02
Buenas a todos. Necesito ayuda ya que en un jsp en código java tengo la siguiente sentencia
que me da error.
String descripcionAux = sDescripcion.replace(/~/g,"\n");
El código total es el siguiente:
<%
{
//JSP Para llenar la combo
//Referencia a la Clase Conexion.
Conexion con= new Conexion();
String dir=con.getDir();
try
{
//Crear la conexion
Connection conn;
conn=DriverManager.getConnection(dir);
//prepara la sentencia
Statement selectStmt;
selectStmt=conn.createStatement();
//ejecutar sentencia y recoger resultado
ResultSet selectResult;
selectResult=selectStmt.executeQuery("SELECT TPLINEA, DESCRIPCION FROM PFTC.TBFTC066_NOTA WHERE NRONOTA="+NRONOTA+" AND TPLINEA>'01' ORDER BY NRONOTA,TPLINEA");
while(selectResult.next()){
String sTplinea=selectResult.getString(1);
String sDescripcion=selectResult.getString(2);
String descripcionAux = sDescripcion.replace(/~/g,"\n");
out.println("<TR><TD class='texto'>"+descripcionAux+"</TD></TR>");
}
selectStmt.close();
conn.close();
}
catch(SQLException e)
{
System.out.println(e);
}
}
%>
Muchas gracias de antemano
que me da error.
String descripcionAux = sDescripcion.replace(/~/g,"\n");
El código total es el siguiente:
<%
{
//JSP Para llenar la combo
//Referencia a la Clase Conexion.
Conexion con= new Conexion();
String dir=con.getDir();
try
{
//Crear la conexion
Connection conn;
conn=DriverManager.getConnection(dir);
//prepara la sentencia
Statement selectStmt;
selectStmt=conn.createStatement();
//ejecutar sentencia y recoger resultado
ResultSet selectResult;
selectResult=selectStmt.executeQuery("SELECT TPLINEA, DESCRIPCION FROM PFTC.TBFTC066_NOTA WHERE NRONOTA="+NRONOTA+" AND TPLINEA>'01' ORDER BY NRONOTA,TPLINEA");
while(selectResult.next()){
String sTplinea=selectResult.getString(1);
String sDescripcion=selectResult.getString(2);
String descripcionAux = sDescripcion.replace(/~/g,"\n");
out.println("<TR><TD class='texto'>"+descripcionAux+"</TD></TR>");
}
selectStmt.close();
conn.close();
}
catch(SQLException e)
{
System.out.println(e);
}
}
%>
Muchas gracias de antemano
Valora esta pregunta


0