当前位置: 技术问答>java相关
有关备注。。。。。。。。。。
来源: 互联网 发布时间:2014-12-28
本文导语: 我用的是jdbc:odbc桥来实现从数据库读出数据。为什么不能读不出数据类型为备注型的字段?老是显示如下错误: javax.servlet.ServletException: Exception thrown on line '32' from page 'D:\Program Files\Allaire\JRun\servers\default\default-a...
我用的是jdbc:odbc桥来实现从数据库读出数据。为什么不能读不出数据类型为备注型的字段?老是显示如下错误:
javax.servlet.ServletException: Exception thrown on line '32' from page 'D:\Program Files\Allaire\JRun\servers\default\default-app\person_inf.jsp'.
java.sql.SQLException
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:285)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:376)
at jrun__person_inf2ejspf._jspService(jrun__person_inf2ejspf.java:67)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
而将备注字段改为文本型的又可以正常运行?这是为什么?难道说用jdbc:odbc桥不能读出备注型字段??
javax.servlet.ServletException: Exception thrown on line '32' from page 'D:\Program Files\Allaire\JRun\servers\default\default-app\person_inf.jsp'.
java.sql.SQLException
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:285)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:376)
at jrun__person_inf2ejspf._jspService(jrun__person_inf2ejspf.java:67)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
而将备注字段改为文本型的又可以正常运行?这是为什么?难道说用jdbc:odbc桥不能读出备注型字段??
|
为什么不试试getBlob呢?
getBlob
public Blob getBlob(String colName)
throws SQLException
JDBC 2.0 Gets a BLOB value in the current row of this ResultSet object.
Parameters:
colName - the name of the column from which to retrieve the value
Returns:
a Blob object representing the SQL BLOB value in the specified column
--------------------------------------------------------------------------------
getBlob
public Blob getBlob(String colName)
throws SQLException
JDBC 2.0 Gets a BLOB value in the current row of this ResultSet object.
Parameters:
colName - the name of the column from which to retrieve the value
Returns:
a Blob object representing the SQL BLOB value in the specified column
--------------------------------------------------------------------------------
|
是不是不能用getString()进行调用,使一使getBinaryStream()会怎么样呢?
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。