SQL Parameter Error

I am having problems with Creator. I am creating a simple app that manages courses at a school. Once the user is logged in and his credentials are stored in the sessionbean, the app is customized to that user. If the user logs in as a professor, it brings him to a page that has a table of buttons that list the courses he teaches. If he clicks on a button, it takes him to a list of exams that he has created for that class. Simple enough. I can't get the last bit of the code to work. If I click on one of the class buttons, or try to sort, or anything else that does a page back, I get the error listed below. I tried removing the code that does the navigation and still get the error. I tried putting the code from the prerender section in the button action method, but nothing works. If you are trying to sort the datatable, why is it making a call to the database? If I'm right, it should be just sorting the records in the dataset. Code and error follows...

Code:

prerender:

try {

//associate userID with the waiting parameter 1 in WHERE

//clause in tblcourseRowSet

getTblcourseRowSet().setObject(1,

getSessionBean1().getLoginBean().getUserID());

getTblcourseDataProvider().refresh();

} catch (Exception e){

error("Cannot read courses for"+":"+e.getMessage());

log("Cannot read courses for "+ getSessionBean1().getLoginBean().getUserID()+":",e);

}

action:

try {

//associate userID with the waiting parameter 1 in WHERE

//clause in tblcourseRowSet

getTblcourseRowSet().setObject(1,

getSessionBean1().getLoginBean().getUserID());

getTblcourseDataProvider().refresh();

} catch (Exception e){

error("Cannot read courses for"+":"+e.getMessage());

log("Cannot read courses for "+ getSessionBean1().getLoginBean().getUserID()+":",e);

}

return null;

Error:

Exception Handler

Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.

Exception Details: java.sql.SQLException

Dynamic parameter markers and Bind variable count mismatch. Number of parameter markers: 1. Number of bind variables: 0.

Possible Source of Error:

Class Name: com.pointbase.net.netJDBCPrimitives

File Name: DashoA13*..

Method Name: handleResponse

Line Number: 370

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

Stack Trace:

com.pointbase.net.netJDBCPrimitives.handleResponse(DashoA13*..:370)

com.pointbase.net.netJDBCPrimitives.handleJDBCObjectResponse(DashoA13*..:418)

com.pointbase.net.netJDBCPreparedStatement.executeQuery(DashoA13*..:175)

com.sun.sql.rowset.internal.CachedRowSetXReader.readData(CachedRowSetXReader.ja va:193)

com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:950)

com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:1410)

com.sun.data.provider.impl.CachedRowSetDataProvider.checkExecute(CachedRowSetDa taProvider.java:1219)

com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorRow(CachedRowSetDa taProvider.java:329)

com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorIndex(CachedRowSet DataProvider.java:300)

com.sun.data.provider.impl.CachedRowSetDataProvider.getRowCount(CachedRowSetDat aProvider.java:624)

com.sun.rave.web.ui.component.TableRowGroup.getRowKeys(TableRowGroup.java:806)

com.sun.rave.web.ui.component.TableRowGroup.getFilteredRowKeys(TableRowGroup.ja va:429)

com.sun.rave.web.ui.component.TableRowGroup.getSortedRowKeys(TableRowGroup.java :1385)

com.sun.rave.web.ui.component.TableRowGroup.getRenderedRowKeys(TableRowGroup.ja va:876)

com.sun.rave.web.ui.component.TableRowGroup.iterate(TableRowGroup.java:1956)

com.sun.rave.web.ui.component.TableRowGroup.processDecodes(TableRowGroup.java:1 679)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

com.sun.rave.web.ui.component.Form.processDecodes(Form.java:78)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:306)

com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase .java:79)

com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

java.lang.reflect.Method.invoke(Method.java:585)

org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)

java.security.AccessController.doPrivileged(AccessController.java:-2)

javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)

java.security.AccessController.doPrivileged(AccessController.java:-2)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)

com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:210)

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)

java.security.AccessController.doPrivileged(AccessController.java:-2)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)

org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:653)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:534)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.jav a:403)

com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)

Exception Details: java.lang.RuntimeException

java.sql.SQLException: Dynamic parameter markers and Bind variable count mismatch. Number of parameter markers: 1. Number of bind variables: 0.

Possible Source of Error:

Class Name: com.sun.data.provider.impl.CachedRowSetDataProvider

File Name: CachedRowSetDataProvider.java

Method Name: setCursorRow

Line Number: 343

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

Stack Trace:

com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorRow(CachedRowSetDa taProvider.java:343)

com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorIndex(CachedRowSet DataProvider.java:300)

com.sun.data.provider.impl.CachedRowSetDataProvider.getRowCount(CachedRowSetDat aProvider.java:624)

com.sun.rave.web.ui.component.TableRowGroup.getRowKeys(TableRowGroup.java:806)

com.sun.rave.web.ui.component.TableRowGroup.getFilteredRowKeys(TableRowGroup.ja va:429)

com.sun.rave.web.ui.component.TableRowGroup.getSortedRowKeys(TableRowGroup.java :1385)

com.sun.rave.web.ui.component.TableRowGroup.getRenderedRowKeys(TableRowGroup.ja va:876)

com.sun.rave.web.ui.component.TableRowGroup.iterate(TableRowGroup.java:1956)

com.sun.rave.web.ui.component.TableRowGroup.processDecodes(TableRowGroup.java:1 679)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

com.sun.rave.web.ui.component.Form.processDecodes(Form.java:78)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)

javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:306)

com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase .java:79)

com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

java.lang.reflect.Method.invoke(Method.java:585)

org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)

java.security.AccessController.doPrivileged(AccessController.java:-2)

javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)

java.security.AccessController.doPrivileged(AccessController.java:-2)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)

com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:210)

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)

java.security.AccessController.doPrivileged(AccessController.java:-2)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)

org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:653)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:534)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.jav a:403)

com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)

[13331 byte] By [whitejf30114] at [2007-11-26 8:58:30]
# 1
In both cases, the error message is:Dynamic parameter markers and Bind variable count mismatch.Does getTblcourseRowSet's query has a parameter set to it?
KarthikR at 2007-7-6 23:00:19 > top of Java-index,Development Tools,Java Tools...