java.sql.SQLException:ORA-03115:不支持的网络数据类型或表示形式 [英] java.sql.SQLException: ORA-03115: unsupported network datatype or representation

查看:146
本文介绍了java.sql.SQLException:ORA-03115:不支持的网络数据类型或表示形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Oracle 11g数据库.当我尝试从db访问数据时,它显示错误java.sql.SQLException:ORA-03115:不支持的网络数据类型或表示形式.我不明白此错误的含义.

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

我的代码是:

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

推荐答案

而不是:

rs = ps.executeQuery(Query);

您应执行:

rs = ps.executeQuery();

否则,您不准备您的语句并丢失所有参数,因为您为它分配了新的SQL语句(即使它是相同的).

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

这篇关于java.sql.SQLException:ORA-03115:不支持的网络数据类型或表示形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆