[Seasar-user:11948] ODBC(MS Access)を利用したs2jdbcでパラメータ数が少なくエラーになる。
Keigo Nakatani
[E-MAIL ADDRESS DELETED]
2007年 12月 6日 (木) 20:07:01 JST
はじめましてk5と申します。
s2jdbcを利用したアプリケーションを作成していますが困っています。
jdbcManager.selectBySql().・・・だとデータが取得できるのですが、
jdbcManager.from(**.class).・・・を使用するとエラーになってしまいます。
以下に環境等詳細を記述します。
Accessを使っちゃいけないのかな?!でも、予算的に小さいアプリを作りたいので
Accessがよいのですが^ ^;
ご教授お願いします。
・環境としては
・DB:MSAccess
・ODBC:ユーザDNSでDriver do Microsoft Access(*.mdb)
・DB名:lats
・ユーザ名:なし
・パスワード:なし
・ApServer:GlassFish V2
です。
・jdbc.diconの記述
<component name="xaDataSource"
class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
<property name="driverClassName">
"sun.jdbc.odbc.JdbcOdbcDriver"
</property>
<property name="URL">
"jdbc:odbc:lats"
</property>
<property name="user">""</property>
<property name="password">""</property>
</component>
・正常に動くプログラム
List<MTorihiki> result = jdbcManager.selectBySql(MTorihiki.class,
"select * from M_TORIHIKI").getResultList();
・エラーになるプログラム
List<MTorihiki> result =
jdbcManager.from(MTorihiki.class).getResultList();
ログを見ていても出力されているSQLは正しそうですが・・・
・ログの内容
[#|2007-12-06T18:58:45.625+0900|WARNING|sun-appserver9.1|com.sun.portal.port
letcontainer.portletappengine|_ThreadID=15;_ThreadName=httpSSLWorkerThread-8
080-0;_RequestID=f7d78143-c652-4f7e-9ce4-711a5b0222b5;|PSPL_PAECSPPA0004 :
Error occured while processing portlet request.
org.seasar.framework.exception.SQLRuntimeException: [ESSR0072]SQLで例外
(SQL=[select T1_.KOZA, T1_.NAME, T1_.ZANDAKA1, T1_.ZANDAKA2, T1_.ZANDAKA3
from M_TORIHIKI T1_], Message=[[ESSR0072]SQLで例外(SQL=[select T1_.KOZA,
T1_.NAME, T1_.ZANDAKA1, T1_.ZANDAKA2, T1_.ZANDAKA3 from M_TORIHIKI T1_],
Message=[-3010], ErrorCode=07001, SQLState={3})が発生しました : [SQLで例外
(Message=[[Microsoft][ODBC Microsoft Access Driver] パラメータが少なすぎま
す。3 を指定してください。], ErrorCode=-3010, SQLState=07001)が発生しまし
た。], [[Microsoft][ODBC Microsoft Access Driver] パラメータが少なすぎます。
3 を指定してください。], ErrorCode=-3010, SQLState=07001)が発生しました
at
org.seasar.framework.util.PreparedStatementUtil.executeQuery(PreparedStateme
ntUtil.java:48)
at
org.seasar.extension.jdbc.query.AbstractSelect.createResultSet(AbstractSelec
t.java:315)
at
org.seasar.extension.jdbc.query.AbstractSelect.getResultListInternal(Abstrac
tSelect.java:184)
at
org.seasar.extension.jdbc.query.AbstractSelect.getResultList(AbstractSelect.
java:164)
at
jp.co.annex.lats.service.impl.TradeAccountServiceImpl.searchTradeAccount(Unk
nown Source)
at
jp.co.annex.lats.service.impl.TradeAccountServiceImpl$$EnhancedByS2AOP$$7439
fe.$$searchTradeAccount$$invokeSuperMethod$$(TradeAccountServiceImpl$$Enhanc
edByS2AOP$$7439fe.java)
at
jp.co.annex.lats.service.impl.TradeAccountServiceImpl$$EnhancedByS2AOP$$7439
fe$$MethodInvocation$$searchTradeAccount0.proceed(MethodInvocationClassGener
ator.java)
at
org.seasar.extension.tx.DefaultTransactionCallback.execute(DefaultTransactio
nCallback.java:58)
at
org.seasar.extension.tx.adapter.JTATransactionManagerAdapter.required(JTATra
nsactionManagerAdapter.java:65)
at
org.seasar.extension.tx.RequiredInterceptor.invoke(RequiredInterceptor.java:
41)
at
jp.co.annex.lats.service.impl.TradeAccountServiceImpl$$EnhancedByS2AOP$$7439
fe$$MethodInvocation$$searchTradeAccount0.proceed(MethodInvocationClassGener
ator.java)
at
org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceIntercept
or.java:73)
at
jp.co.annex.lats.service.impl.TradeAccountServiceImpl$$EnhancedByS2AOP$$7439
fe$$MethodInvocation$$searchTradeAccount0.proceed(MethodInvocationClassGener
ator.java)
at
jp.co.annex.lats.service.impl.TradeAccountServiceImpl$$EnhancedByS2AOP$$7439
fe.searchTradeAccount(TradeAccountServiceImpl$$EnhancedByS2AOP$$7439fe.java)
at jp.co.annex.lats.portlet.SummaryPortlet.doView(Unknown Source)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:247)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:175)
at
com.sun.portal.portletcontainer.portletappengine.PortletAppEngineServlet.ser
vice(PortletAppEngineServlet.java:343)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFi
lterChain.java:411)
at
org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatche
r.java:855)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:703)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:660)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:578)
at
com.sun.portal.portletcontainer.impl.PortletContainer.invokePAE(PortletConta
iner.java:554)
at
com.sun.portal.portletcontainer.impl.PortletContainer.invokePAE(PortletConta
iner.java:467)
at
com.sun.portal.portletcontainer.impl.PortletContainer.getMarkup(PortletConta
iner.java:187)
at
com.sun.portal.portletcontainer.invoker.WindowInvoker.getPortletContent(Wind
owInvoker.java:343)
at
com.sun.portal.portletcontainer.invoker.WindowInvoker.render(WindowInvoker.j
ava:242)
at
com.sun.portal.portletcontainer.driver.PortletContent.getContent(PortletCont
ent.java:68)
at
com.sun.portal.portletcontainer.driver.DesktopServlet.getPortletContents(Des
ktopServlet.java:230)
at
com.sun.portal.portletcontainer.driver.DesktopServlet.getAllPortletContents(
DesktopServlet.java:194)
at
com.sun.portal.portletcontainer.driver.DesktopServlet.doGetPost(DesktopServl
et.java:110)
at
com.sun.portal.portletcontainer.driver.DesktopServlet.doGet(DesktopServlet.j
ava:80)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFi
lterChain.java:411)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:290)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:271)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:202)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206
)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632
)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(
DefaultProcessorTask.java:637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(Defa
ultProcessorTask.java:568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(Defaul
tProcessorTask.java:813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTas
k(DefaultReadTask.java:339)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadT
ask.java:261)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadT
ask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerTh
read.java:106)
Caused by: org.seasar.framework.exception.SSQLException: [ESSR0072]SQLで例外
(SQL=[select T1_.KOZA, T1_.NAME, T1_.ZANDAKA1, T1_.ZANDAKA2, T1_.ZANDAKA3
from M_TORIHIKI T1_], Message=[-3010], ErrorCode=07001, SQLState={3})が発生
しました
at
org.seasar.extension.jdbc.impl.PreparedStatementWrapper.wrapException(Prepar
edStatementWrapper.java:72)
at
org.seasar.extension.jdbc.impl.PreparedStatementWrapper.wrapException(Prepar
edStatementWrapper.java:67)
at
org.seasar.extension.jdbc.impl.PreparedStatementWrapper.executeQuery(Prepare
dStatementWrapper.java:83)
at
org.seasar.framework.util.PreparedStatementUtil.executeQuery(PreparedStateme
ntUtil.java:46)
... 61 more
Caused by: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
パラメータが少なすぎます。3 を指定してください。
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3150)
at
sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.ja
va:214)
at
sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStateme
nt.java:89)
at
org.seasar.extension.jdbc.impl.PreparedStatementWrapper.executeQuery(Prepare
dStatementWrapper.java:81)
... 62 more
Seasar-user メーリングリストの案内