我试图在数据库中的CLOB类型列中插入一个很长的字符串,它基本上是一个base64编码的图像字符串,但我得到了异常java.sql.sqlsyntaxerroreXception。做这件事的正确方法是什么?
我尝试了setClob()中的Clob对象和setClob()中的reader对象,但给出了相同的异常“java.sql.sqlsyntaxerrorexception”,并且我将OJDBC14.jar更新为OJDBC6.jar,就像以前给出的“java.lang.AbstractMethoderror:Method oracle/jdbc/driver/t4cpreparedStatement.setClob(iljava/io/reader;)”一样.
String uid = (String)session.getAttribute("uid");
String userPhoto = request.getParameter("userPhoto");
String AadhaarImageURI = request.getParameter("AadhaarImageURI");
System.out.println(uid+"\n"+userPhoto+"\n"+AadhaarImageURI);
//StringReader reader1 = new StringReader(userPhoto);
//StringReader reader2 = new StringReader(AadhaarImageURI);
try {
Connection con = Connect_db.getCon();
PreparedStatement ps= con.prepareStatement("update aadhardb set userimg=?, aadharimg=?, where u_id=?");
Clob myclob = con.createClob();
myclob.setString(1, userPhoto);
Clob myclob2 = con.createClob();
myclob2.setString(1,AadhaarImageURI);
ps.setClob(1,myclob);
ps.setClob(2,myclob2);
ps.setString(3,uid);
ps.execute();
con.close();
}
catch(Exception e){
e.printStackTrace(); }
我想用字符串(>4000)更新CLOB列。
下面是完整的堆栈跟踪。
java.sql.sqlsyntaxerroreXception:ORA-01747:无效的user.table.column、table.column或column规范
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:953)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3488)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
at org.apache.jsp.userAadhaarEntry_jsp._jspService(userAadhaarEntry_jsp.java:141)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
在哪里之前不应该是逗号
PreparedStatement ps= con.prepareStatement("update aadhardb set userimg=?, aadharimg=? where u_id=?");
我以前很难学到这个。
线程“main”org.openqa.selenium.nosuchelementexception:无法找到元素:{“method”:“xpath”,“selector”:“.//*[@id='full-scorecard']/div[2]/div/table[1]/tbody/tr[20]/td[2]/a”}命令持续时间或超时:40毫秒有关此错误的文档,请访问:http://seleniumh
下面是我的代码: 如果有人能给我一些想法,我将不胜感激:)
下面是我遇到错误的程序: //导入扫描程序类导入java。util。扫描仪; 这些是我得到的错误:
当我试图运行这个骨架代码时,我一直收到这个错误。我试图在Eclipse中使用OpenGL。我不知道是什么导致了这个问题。我如何解决这个问题?我也已经将jar文件添加到用户库中。 代码: 这是我一直在犯的错误。 错误:错误1 错误2 Plhd-19/>(JComponent. java: 4839)在java.桌面/java. awt.容器. addNotify(容器. java: 2804)在ja
C:\Users\georg\Desktop\reactapp reactapp@1.0.0启动网页包开发服务器--热 节点:内部/模块/cjs/加载器:927抛出错误^ 错误:找不到模块'webpack-cli/bin/config-yargs'需要堆栈: C:\用户\georg\Desktop\reactapp\node_modules\webpack-dev-server\bin\webpa