Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.sql.SQLException: ORA-03115: unsupported network datatype or representation

Tags:

I'm Using Oracle 11g database. When i try to access data from db it was showing the error java.sql.SQLException: ORA-03115: unsupported network datatype or representation. I'm not understanding what this error means..

my code is :

 String uname,pass;
    ResultSet rs = null;
    response.setContentType("text/html");
    PrintWriter out=response.getWriter();
  try
  {
    uname=request.getParameter("uname");
    pass=request.getParameter("pass");
    Connection con=prepareConnection();
    String Query="select uname from passmanager where pass=?";
    PreparedStatement ps=con.prepareStatement(Query);
    ps.setString(1,pass);
    rs=ps.executeQuery(Query);
    if (rs.next() && uname.equalsIgnoreCase(rs.getString("uname")) || uname.equalsIgnoreCase(rs.getString("email"))) {
    HttpSession session = request.getSession(true);
    session.setAttribute("uname", rs.getString(1));

    ServletContext context = getServletContext();
    RequestDispatcher dispatcher = context
                    .getRequestDispatcher("/profile");
    dispatcher.forward(request, response);
  }

Any one help me to solve this problem..

like image 961
ajay Avatar asked Jan 13 '13 10:01

ajay


1 Answers

Instead of:

rs = ps.executeQuery(Query);

you should execute:

rs = ps.executeQuery();

Otherwise, you unprepare your statement and lose all parameters because you assign it a new SQL statement (even though it's the same).

like image 142
Codo Avatar answered Sep 29 '22 23:09

Codo