at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getInt(Unknown Source)
at zero.space.ch03.TitleBean.getTitles(TitleBean.java:33)
at org.apache.jsp.ch03.books_jsp._jspService(books_jsp.java:92)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
9 个解决方案
#1
这不是有说了么?
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getInt(Unknown Source)
at zero.space.ch03.TitleBean.getTitles(TitleBean.java:33)
at org.apache.jsp.ch03.books_jsp._jspService(books_jsp.java:92)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getInt(Unknown Source)
at zero.space.ch03.TitleBean.getTitles(TitleBean.java:33)
at org.apache.jsp.ch03.books_jsp._jspService(books_jsp.java:92)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
#2
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
#3
一楼的朋友的头像???!!!!。。。。 是。。。
#4
顺序不对,要和表中的顺序对应。
建议你这样写:
String isbn = rs.getString("isbn") ;
String title = rs.getString("title");
...
book.setIsbn(isbn);
book.setTitle(title);
...
这种写法不用考虑表中的顺序。
建议你这样写:
String isbn = rs.getString("isbn") ;
String title = rs.getString("title");
...
book.setIsbn(isbn);
book.setTitle(title);
...
这种写法不用考虑表中的顺序。
#5
不是啊 我表中的顺序和程序中的是一样的 顺便您的提议很好 我以后一定借鉴
#6
先getString,再转下试试
#7
你怎么还说是一样呢?你看清楚一点。 editionNumber int not null, --版本 和 列名 editonNumber 无效。少了一个i
#8
com.microsoft.sqlserver.jdbc.SQLServerException: 列名
editonNumber 无效。
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
建议你以后写程序时重要东西要copy。
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
建议你以后写程序时重要东西要copy。
#9
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
呵呵,我也来说说吧,
楼主, 如果你用的是可调式的编译器,建议设置断点,一调试,保证一下子就给你检查出来了,不管是你的列名对不对,顺序行不行,还是其他的什么,设置断点调试的时候,你能够看到它的值,这个时候虽然不是什么技巧,但是需要楼主会这些东西,呵呵,
或者是这个方法不行,就跟楼上以为仁兄说的,你用get方法吧,然后把它system出来,呵呵,就是打印,这样就会十分容易的就检查到错误了
这个是对症下药,希望楼主采纳
#1
这不是有说了么?
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getInt(Unknown Source)
at zero.space.ch03.TitleBean.getTitles(TitleBean.java:33)
at org.apache.jsp.ch03.books_jsp._jspService(books_jsp.java:92)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getInt(Unknown Source)
at zero.space.ch03.TitleBean.getTitles(TitleBean.java:33)
at org.apache.jsp.ch03.books_jsp._jspService(books_jsp.java:92)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
#2
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
#3
一楼的朋友的头像???!!!!。。。。 是。。。
#4
顺序不对,要和表中的顺序对应。
建议你这样写:
String isbn = rs.getString("isbn") ;
String title = rs.getString("title");
...
book.setIsbn(isbn);
book.setTitle(title);
...
这种写法不用考虑表中的顺序。
建议你这样写:
String isbn = rs.getString("isbn") ;
String title = rs.getString("title");
...
book.setIsbn(isbn);
book.setTitle(title);
...
这种写法不用考虑表中的顺序。
#5
不是啊 我表中的顺序和程序中的是一样的 顺便您的提议很好 我以后一定借鉴
#6
先getString,再转下试试
#7
你怎么还说是一样呢?你看清楚一点。 editionNumber int not null, --版本 和 列名 editonNumber 无效。少了一个i
#8
com.microsoft.sqlserver.jdbc.SQLServerException: 列名
editonNumber 无效。
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
建议你以后写程序时重要东西要copy。
数据库表中的列名和我程序中使用的是一样的
create table titles
(
isbn varchar(20) primary key, --图书编码
title varchar(100) not null , --书名
editionNumber int not null, --版本
copyright varchar(20) not null, --版权
publisherID int not null , --出版商ID
imageFile varchar(20) not null, --封面图片
price numeric(9) not null, --价格
)
go
book.setIsbn(rs.getString("isbn")
book.setTitle(rs.getString("title"));
book.setEditionNumber(rs.getInt("editionNumber"));
book.setCopyRight(rs.getString("copyright"));
book.setPublisherID(rs.getInt("publicID"));
book.setImageFile(rs.getString("imageFile"));
book.setPrice(rs.getDouble("price"));
建议你以后写程序时重要东西要copy。
#9
com.microsoft.sqlserver.jdbc.SQLServerException: 列名 editonNumber 无效。
呵呵,我也来说说吧,
楼主, 如果你用的是可调式的编译器,建议设置断点,一调试,保证一下子就给你检查出来了,不管是你的列名对不对,顺序行不行,还是其他的什么,设置断点调试的时候,你能够看到它的值,这个时候虽然不是什么技巧,但是需要楼主会这些东西,呵呵,
或者是这个方法不行,就跟楼上以为仁兄说的,你用get方法吧,然后把它system出来,呵呵,就是打印,这样就会十分容易的就检查到错误了
这个是对症下药,希望楼主采纳