Subject | Re: User Defined Functions and PreparedStatement class |
---|---|
Author | sergeybervinov |
Post date | 2003-03-29T16:02:37Z |
дЮ, Ъ НАПЮЫЮЧ БЮЬЕ БМХЛЮМХЕ МЮ РН, ВРН Б Statement UDF ОПЕЙПЮЯМН
ПЮАНРЮЕР. ю БНР Б PreparedStatement БНГМХЙЮЕР ХЯЙКЧВЕМХЕ МЮ ЩРЮОЕ
ОНДЦНРНБЙХ ХМЯРПСЙЖХХ.
бНР ПЮАНВХИ ОПХЛЕП:
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT id " +
"FROM users " +
"WHERE UPPER(user_login) = UPPER('" + user + "') AND " +
" user_password = MD5('" + password + "')"
);
Ю БНР ОПХЛЕП МЕ ПЮАНВХИ, ЙНРНПШИ БШАПЮЯШБЮЕР ХЯЙКЧВЕМХЕ МЮ ЩРЮОЕ
ОНДЦНРНБЙХ, Р.Е. Б РНИ ХМЯРПСЙЖХХ, ЙНРНПСЧ Ъ ОПХБНФС:
PreparedStatement pstmt = connection.prepareStatement(
"SELECT id " +
"FROM users " +
"WHERE UPPER(user_login) = UPPER(?) AND " +
" user_password = ?"
);
мС Ю ЦЕМЕПХПСЕРЯЪ ЯКЕДСЧЫЕЕ:
[MobileAdmin Server: James] [SQL Error Code: 335544569]
mobile.admin.server.RuntimeServerException:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
SQL error code = -804
Data type unknown
at mobile.admin.server.Server.mobileRuntimeException
(Server.java:91)
at mobile.admin.server.Server.login(Server.java:169)
at mobile.admin.jsp.LoginJSPBean.handleFormActions
(LoginJSPBean.java:55)
at mobile.admin.jsp.AbstractJSPBean.initBean
(AbstractJSPBean.java:48)
at org.apache.jsp.login$jsp._jspService(login$jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke
(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process
(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:536)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception.
Dynamic SQL Error
SQL error code = -804
Data type unknown
at org.firebirdsql.jdbc.FBPreparedStatement.<init>
(FBPreparedStatement.java:76)
at org.firebirdsql.jdbc.FBConnection.prepareStatement
(FBConnection.java:223)
at mobile.admin.server.Server.login(Server.java:154)
... 39 more
[MobileAdmin Client] mobile.admin.server.RuntimeServerException:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
SQL error code = -804
Data type unknown
at mobile.admin.server.Server.mobileRuntimeException
(Server.java:91)
at mobile.admin.server.Server.login(Server.java:169)
at mobile.admin.jsp.LoginJSPBean.handleFormActions
(LoginJSPBean.java:55)
at mobile.admin.jsp.AbstractJSPBean.initBean
(AbstractJSPBean.java:48)
at org.apache.jsp.login$jsp._jspService(login$jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke
(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process
(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:536)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception.
Dynamic SQL Error
SQL error code = -804
Data type unknown
at org.firebirdsql.jdbc.FBPreparedStatement.<init>
(FBPreparedStatement.java:76)
at org.firebirdsql.jdbc.FBConnection.prepareStatement
(FBConnection.java:223)
at mobile.admin.server.Server.login(Server.java:154)
... 39 more
ПЮАНРЮЕР. ю БНР Б PreparedStatement БНГМХЙЮЕР ХЯЙКЧВЕМХЕ МЮ ЩРЮОЕ
ОНДЦНРНБЙХ ХМЯРПСЙЖХХ.
бНР ПЮАНВХИ ОПХЛЕП:
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT id " +
"FROM users " +
"WHERE UPPER(user_login) = UPPER('" + user + "') AND " +
" user_password = MD5('" + password + "')"
);
Ю БНР ОПХЛЕП МЕ ПЮАНВХИ, ЙНРНПШИ БШАПЮЯШБЮЕР ХЯЙКЧВЕМХЕ МЮ ЩРЮОЕ
ОНДЦНРНБЙХ, Р.Е. Б РНИ ХМЯРПСЙЖХХ, ЙНРНПСЧ Ъ ОПХБНФС:
PreparedStatement pstmt = connection.prepareStatement(
"SELECT id " +
"FROM users " +
"WHERE UPPER(user_login) = UPPER(?) AND " +
" user_password = ?"
);
мС Ю ЦЕМЕПХПСЕРЯЪ ЯКЕДСЧЫЕЕ:
[MobileAdmin Server: James] [SQL Error Code: 335544569]
mobile.admin.server.RuntimeServerException:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
SQL error code = -804
Data type unknown
at mobile.admin.server.Server.mobileRuntimeException
(Server.java:91)
at mobile.admin.server.Server.login(Server.java:169)
at mobile.admin.jsp.LoginJSPBean.handleFormActions
(LoginJSPBean.java:55)
at mobile.admin.jsp.AbstractJSPBean.initBean
(AbstractJSPBean.java:48)
at org.apache.jsp.login$jsp._jspService(login$jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke
(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process
(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:536)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception.
Dynamic SQL Error
SQL error code = -804
Data type unknown
at org.firebirdsql.jdbc.FBPreparedStatement.<init>
(FBPreparedStatement.java:76)
at org.firebirdsql.jdbc.FBConnection.prepareStatement
(FBConnection.java:223)
at mobile.admin.server.Server.login(Server.java:154)
... 39 more
[MobileAdmin Client] mobile.admin.server.RuntimeServerException:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. Dynamic SQL Error
SQL error code = -804
Data type unknown
at mobile.admin.server.Server.mobileRuntimeException
(Server.java:91)
at mobile.admin.server.Server.login(Server.java:169)
at mobile.admin.jsp.LoginJSPBean.handleFormActions
(LoginJSPBean.java:55)
at mobile.admin.jsp.AbstractJSPBean.initBean
(AbstractJSPBean.java:48)
at org.apache.jsp.login$jsp._jspService(login$jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke
(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke
(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke
(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke
(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext
(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process
(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run
(HttpProcessor.java:1125)
at java.lang.Thread.run(Thread.java:536)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception.
Dynamic SQL Error
SQL error code = -804
Data type unknown
at org.firebirdsql.jdbc.FBPreparedStatement.<init>
(FBPreparedStatement.java:76)
at org.firebirdsql.jdbc.FBConnection.prepareStatement
(FBConnection.java:223)
at mobile.admin.server.Server.login(Server.java:154)
... 39 more