当前位置: 技术问答>java相关
一个写数据库的问题?
来源: 互联网 发布时间:2015-02-23
本文导语: 当我向sqlserver数据库写入datetime 字段时总出现如下错误: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]没有执行可选特性 at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188) at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterDate(JdbcOd...
当我向sqlserver数据库写入datetime 字段时总出现如下错误:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]没有执行可选特性
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterDate(JdbcOdbc.java:752)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setDate(JdbcOdbcPreparedStatement.java:833)
at SkhsDu1_sqcb.xieShuJuKu(SkhsDu1_sqcb.java:182)
at SkhsDu1_sqcb.doGet(SkhsDu1_sqcb.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
不知道什么意思?如何解决呢?答者有分
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]没有执行可选特性
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterDate(JdbcOdbc.java:752)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setDate(JdbcOdbcPreparedStatement.java:833)
at SkhsDu1_sqcb.xieShuJuKu(SkhsDu1_sqcb.java:182)
at SkhsDu1_sqcb.doGet(SkhsDu1_sqcb.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
不知道什么意思?如何解决呢?答者有分
|
改一下datetime
其实你可以用String 格式表示出datetime,java支持把String 插入到datetime中去
其实你可以用String 格式表示出datetime,java支持把String 插入到datetime中去