• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with ResultSet

 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody. I�m having a problem with the Result Set Type that i�m
trying to create.
When i create a Result Set that is scrollabe and updatable i get an
error
message when the servlet is called. I�m posting the code i�m using and
the
error message. I hope anybody can help me.
Code:
Statement st;
st = null;
ResultSet rs;
rs = null;
ResultSetMetaData rsmeta;
try{

st =
cnx.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDAT
ABLE);
System.out.println("el tipo resultset "+st.getResultSetType());
rs = st.executeQuery("SELECT a.titulo, a.entradilla, a.texto,
a.titulo_cat, a.entradilla_cat, a.texto_cat, a.titulo_eus,
a.entradilla_eus,
a.texto_eus, a.titulo_gal, a.entradilla_gal, a.texto_gal, a.titulo_ing,
a.entradilla_ing, a.texto_ing, a.titulo_val, a.entradilla_val,
a.texto_val,
b.ruta_foto, b.orden FROM EROSKIES.CONTENIDO a,
EROSKIES.CONTENIDO_FOTOS b
WHERE a.id_contenido="+id_contenido+"AND
b.id_contenido="+id_contenido+"");
//Aqui tengo que meter la sql y a�adir datos al vector si voy a usar
vector
rsmeta=rs.getMetaData();
String cursor=rs.getCursorName();
//rs.first();
System.out.println("cursor: "+cursor);
}
catch(SQLException sql){
System.out.println(" tengo Error SQL: ");
System.out.println(sql.getMessage());
//sql.printStackTrace();
}
finally
{
if(st != null)
try
{
rs.close();
st.close();
}
catch(SQLException e)
{
System.out.println("Se ha producido un error al cerrar la
conexion");
System.out.println(e.getMessage());
}
}
//Aqui llamada a mostrarContenido;
}

And this is the stack trace:
java.lang.UnsupportedOperationException
at
sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.java:101
8)
at
com.attest.eroski.ContenidoServlet.mirarBaseDatos(ContenidoServlet.java:200)
at com.attest.eroski.ContenidoServlet.doGet(ContenidoServlet.java:133)
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would appear that the JDBC driver that you're using doesn't support that operation (at least not with those parameters).
You'd probably have better luck getting a good response in the JDBC forum.
Corey
 
Doug Wang
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems that its your JDBC driver's fault. Make sure ur using JDBC 2.0 version Api supported Driver.
Maybe you want check out available drivers that support JDBC2.x API.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!