我已使用sqlitejdbc-v056.jar
成功为SQLite数据库创建了ColdFusion数据源。然后我将此查询添加到我的.cfm页面
<cfquery name="qry" datasource="Spiceworks">
SELECT
id AS Ticket_Number,
summary AS Summary,
status AS Status,
created_at AS Created_At,
assigned_to AS Assigned_to
FROM tickets
WHERE status = 'open' AND assigned_to IS NULL
ORDER BY Created_At DESC
</cfquery>
当我浏览IE和Firefox中的.cfm页面时,出现错误:
未由SQLite JDBC驱动程序实现
错误发生在C:/Inetpub/wwwroot/intra/SmartTV/UnassignedTickets/Tickets.cfm:第204行
202:
203:
204:
205:选择
206:id,SQL SELECT id,summary,status,created_at,assigned_to FROM ticket WHERE status ='open'AND assigned_to IS NULL ORDER BY created_at DESC DATASOURCE Spiceworks资源:
Check the ColdFusion documentation to verify that you are using the correct syntax. Search the Knowledge Base to find a solution to your problem.
堆栈跟踪
at cfTickets2ecfm1617356019.runPage(C:/Inetpub/wwwroot/intra/SmartTV/UnassignedTickets/Tickets.cfm:204) at cfTickets2ecfm1617356019.runPage(C:/Inetpub/wwwroot/intra/SmartTV/UnassignedTickets/Tickets.cfm:204) java.sql.SQLException: not implemented by SQLite JDBC driver
at org.sqlite.jdbc3.JDBC3Statement.unused(JDBC3Statement.java:397)
at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3Statement.java:414)
at coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:359)
at coldfusion.sql.Executive.executeQuery(Executive.java:1442)
at coldfusion.sql.Executive.executeQuery(Executive.java:1201)
at coldfusion.sql.Executive.executeQuery(Executive.java:1131)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:406)
at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:1056)
at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:685)
at cfTickets2ecfm1617356019.runPage(C:\Inetpub\wwwroot\intra\SmartTV\UnassignedTickets\Tickets.cfm:204)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:428)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)java.sql.SQLException: not implemented by SQLite JDBC driver
at org.sqlite.jdbc3.JDBC3Statement.unused(JDBC3Statement.java:397)
at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3Statement.java:414)
at coldfusion.server.j2ee.sql.JRunStatement.execute(JRunStatement.java:359)
at coldfusion.sql.Executive.executeQuery(Executive.java:1442)
at coldfusion.sql.Executive.executeQuery(Executive.java:1201)
at coldfusion.sql.Executive.executeQuery(Executive.java:1131)
at coldfusion.sql.SqlImpl.execute(SqlImpl.java:406)
at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:1056)
at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:685)
at cfTickets2ecfm1617356019.runPage(C:\Inetpub\wwwroot\intra\SmartTV\UnassignedTickets\Tickets.cfm:204)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:444)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:64)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:428)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
更新
我的.jar文件位于C:\ColdFusion10\cfusion\lib\
和C:\ColdFusion10\cfusion\wwwroot\WEB-INF\lib
下。在ColdFusion数据源中:
<user>
<password>
正如评论中所建议的那样,我尝试了更简单的陈述:
SELECT * FROM tickets
SELECT id, summary, status, assigned_to FROM tickets
但仍然遇到同样的错误。
答案 0 :(得分:3)
我认为原始错误恰恰意味着它所说的内容。数据源调用了一个方法,该方法不是由您正在使用的驱动程序实现的。特别是execute(..)
的{{1}}方法。 The source for this driver表明该方法无效。它只会抛出您看到的错误消息。
但是我认为你的类路径中有另一个版本的SQLite驱动程序jar。您发布的sqlitejdbc-v056.jar
无法导致该错误,因为它甚至不包含org.sqlite.jdbc3.JDBC3Statement
类。可能发生的是CF正在加载另一个版本的驱动程序(即在您的类路径中)。
在我的测试中,JDBC3Statement
与CF10一起工作正常。在再次添加该jar之前,请确保已从CF类路径中删除了所有版本的SQLLite jar,然后重新启动CF.否则,CF仍将自动加载它们,您将继续收到该错误消息。
为确保您已删除所有的jar文件,请在重新启动后尝试创建主类的实例。如果以下行引发“未找到类”错误,则表示已成功删除所有错误。完成后,请继续重新安装sqlitejdbc-v056.jar
。
sqlitejdbc-v056.jar
这对我有用:
<cfset obj = createObject("java", "org.sqlite.JDBC")>
If you see this text, you still have a version of the jar in your class path.
C:/temp/sqlite/products.db
下载到sqlitejdbc-v056.jar