Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

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

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..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...