Error inserting BLOBs in OC4J 9.0.2.1

The following snippet of code works in oc4j 9.0.2.0.0 but not in OC4J 9.0.2.1 Any ideas why?
Thanks,
Rajiv
FileInputStream in = new FileInputStream(file.getPath());
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT blob_info FROM trx_blob WHERE trx_blob_id = ? FOR UPDATE");
ps.setInt(1, blobID);
rs = ps.executeQuery();
rs.next();
BLOB blob = ((OracleResultSet) rs).getBLOB(1);
OutputStream outStream = blob.getBinaryOutputStream();
int size = blob.getBufferSize();
byte[] buffer = new byte[size];
int length = -1;
while ((length = in.read(buffer)) != -1) {
outStream.write(buffer, 0, length);
outStream.close();
in.close();
conn.commit();
The error I get is java.sql.SQLException: ORA-01002: fetch out of seqence

Rajiv -- This looks like bug 2541604. Please ask your support representative for a patch.
Thanks -- Jeff

Similar Messages

  • SQLite3 and BlobsI am having trouble learning how insert blobs into SQLite

    I am having trouble learning how insert blobs into SQLite for the iphone. Is there a way to insert a blob into sqlite3 from the command line? I know it was possible with sql using
    INSERT INTO temponly(name , pic) values( 'velan',
    load_file('e:/mysql/images/Click.gif')) ;
    but I don't think load_file is supported on sqlite.
    Also, I need to insert the blobs from my iphone app. I saw a C program called eatblob.c which goes through the following just to INSERT a blob into sqlite
    1. read the jpeg image file into memory , doing appropriate malloc based on size
    2. prepare an sqlite statement with ? values
    3. bind the malloc'd memory to the ?
    4. execute an sqlite step
    etc. etc. etc....
    This is quite a bit of work just to do an INSERT ???
    The reason I'm doing this is my iphone app has a lot of tiny (20x20) images that get downloaded to the phone periodically from the server. Plus, there are a number of images that come loaded with the application. I was going to save all of these in SQLite. So, I need the command line tool to load up the initial images that come with the app, then I need code to download the images from the server and load them into the database. Of course, reading them out is necessary!
    Please help if you can!? Its late..and I'm blurry eyed from googling SQLIte3 blobs...

    Thank you for your quick reply Liam! You know, I checked the web forms list when I got that error message and the form isn't there. I was having trouble the other day when another of my forms kept getting deleted.
    Sorry if this is a stupid question (I'm a BC newbie) but I want to be sure so I can get this project finished... The proper workflow would be to create this form myself in Web Forms then insert it into the Registration - Buy template using the modules toolbox?
    Thanks to you I may get this done on time still... if my PayPal set up works

  • RegisterOutParameter - setBinaryStream - Problems inserting Blob - setRAW

    As posted in metalink (was: "Problems inserting BLOB/InputStream with ojdbc14.jar for 10g - Data size bigger than max size for this type"):
    Using setBinaryStream for large Blobs works as long as I don't register outParameters.
    Query that works: "INSERT INTO blobtest (attachment_id,name,data) VALUES(blobtest_SEQ.nextval,?,?)";
    Query that fails = "BEGIN INSERT INTO blobtest (attachment_id,name,data) VALUES( blobtest_SEQ.nextval,?,?) RETURN attachment_id INTO ? ; END;"
    The necessary tables were created by hand:
    CREATE TABLE blobtest ( NAME CHAR(255), data BLOB, attachment_id NUMBER(38))
    And
    CREATE SEQUENCE TBL_ATTACHMENT_SEQ
    The output was: <<user: SEE
    pw: QD
    instantiating oracle driver
    query: INSERT INTO blobtest (attachment_id,name,data) VALUES(TBL_ATTACHMENT_SEQ.nextval,?,?)
    uploaded no Return Parameter blob of size: 256809
    query: BEGIN INSERT INTO blobtest (attachment_id,name,data) VALUES(TBL_ATTACHMENT_SEQ.nextval,?,?) RETURN attachment_id INTO ? ; END;
    java.sql.SQLException: Datengr÷&#9600;e gr÷&#9600;er als max. Gr÷&#9600;e f³r diesen Typ: 256809
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :125)
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :162)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setRAW(OraclePreparedState
    ment.java:5342)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setBinaryStreamInternal(Or
    aclePreparedStatement.java:6885)
    at
    oracle.jdbc.driver.OracleCallableStatement.setBinaryStream(OracleCall
    ableStatement.java:4489)
    at BlobTest.writeBlob(BlobTest.java:161)
    at BlobTest.testBlob(BlobTest.java:118)
    at BlobTest.main(BlobTest.java:92)
    error: Datengr÷&#9600;e gr÷&#9600;er als max. Gr÷&#9600;e f³r diesen Typ:
    256809>>
    here the java test case:
    * Created on 25.08.2004 $Id: BlobTest.java,v 1.4 2005/04/22 11:21:11 hauser Exp $
    * as posted in metalink jdbc forum 050405 and responses by
    * [email protected]
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.Types;
    public class BlobTest {
    private static String FILE_NAME = "c:/temp/veryLargeFile.pdf";
    public BlobTest() {
    final static int ORACLE = 1;
    final static int MYSQL = 2;
    private String jdbcUrl = "jdbc:mysql://localhost/test?user=monty&password=greatsqldb";
    private int dbType = ORACLE;
    private Driver driver = null;
    private String user = "";
    private String pw = "";
    public static String SCHEME = "";
    public static void main(String[] args) {
    BlobTest bt = new BlobTest();
    if (args[0] != null) {
    System.out.println("dbType: " + args[0]);
    if (args[0].toLowerCase().indexOf("oracle") != -1) {
    bt.dbType = ORACLE;
    if (args[0].toLowerCase().indexOf("mysql") != -1) {
    bt.dbType = MYSQL;
    } else {
    System.out.println("not yet supported db type: " + args[0]);
    System.exit(99);
    if (args[1] != null) {
    System.out.println("jdbcUrl: " + args[1]);
    if (args[1].trim().length() != 0) {
    bt.jdbcUrl = args[1].trim();
    } else {
    System.out.println("not yet supported jdbcUrl : " + args[1]);
    System.exit(99);
    if (args.length > 2 && args[2] != null) {
    System.out.println("user: " + args[2]);
    if (args[2].trim().length() != 0) {
    bt.user = args[2].trim();
    } else {
    System.out.println("invalid user: " + args[2]);
    System.exit(99);
    if (args.length > 3 && args[3] != null) {
    System.out.println("pw: " + args[3].substring(0, 2));
    if (args[3].trim().length() != 0) {
    bt.pw = args[3].trim();
    } else {
    System.out.println("invalid filename: " + args[3]);
    System.exit(99);
    if (args.length > 4 && args[4] != null) {
    System.out.println("filename: " + args[4]);
    if (args[4].trim().length() != 0) {
    FILE_NAME = args[4].trim();
    } else {
    System.out.println("invalid filename: " + args[4]);
    System.exit(99);
    bt.setUp();
    bt.testBlob();
    public void setUp() {
    try {
    if (this.dbType == ORACLE) {
    System.out.println("instantiating oracle driver ");
    this.driver = (Driver) Class.forName(
    "oracle.jdbc.driver.OracleDriver").newInstance();
    } else {
    this.driver = (Driver) Class.forName("com.mysql.jdbc.Driver")
    .newInstance();
    if (this.driver == null) {
    System.out.println("oracle driver is null");
    System.exit(88);
    DriverManager.registerDriver(this.driver);
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage());
    public void testBlob() {
    try {
    this.writeBlob();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage());
    * testfunction
    private void writeBlob() throws Exception {
    Connection conn = null;
    PreparedStatement pStmt = null;
    CallableStatement cStmt, cStmt2 = null;
    InputStream in = null;
    try {
    File file = new File(BlobTest.FILE_NAME);
    in = new FileInputStream(file);
    conn = DriverManager.getConnection("jdbc:" + this.jdbcUrl,
    this.user, this.pw);
    conn.setAutoCommit(false);
    String queryWorks = "INSERT INTO " + SCHEME
    + "blobtest (attachment_id,name,data) VALUES(" + SCHEME
    + "TBL_ATTACHMENT_SEQ.nextval,?,?)";
    cStmt = conn.prepareCall(queryWorks);
    System.out.println("query: " + queryWorks);
    cStmt.setString(1, file.getAbsolutePath());
    in = new FileInputStream(file);
    cStmt.setBinaryStream(2, in, (int) file.length());
    cStmt.execute();
    System.out.println("uploaded no Return Parameter blob of size: "
    + file.length());
    conn.commit();
    String queryFails = "BEGIN INSERT INTO " + SCHEME
    + "blobtest (attachment_id,name,data) VALUES(" + SCHEME
    + "TBL_ATTACHMENT_SEQ.nextval,?,?)"
    + " RETURN attachment_id INTO ? ; END;";
    cStmt2 = conn.prepareCall(queryFails);
    System.out.println("query: " + queryFails);
    cStmt2.setString(1, file.getAbsolutePath());
    in = new FileInputStream(file);
    cStmt2.setBinaryStream(2, in, (int) file.length());
    cStmt2.registerOutParameter(3, Types.INTEGER);
    cStmt2.execute();
    System.out.println("uploaded blob of size: " + file.length()
    + " - id: " + cStmt2.getInt(3));
    conn.commit();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage() + "\nname: "
    + BlobTest.FILE_NAME);
    if (conn != null) {
    try {
    conn.rollback();
    } catch (Exception e1) {
    throw e;
    } finally {
    if (in != null) {
    try {
    in.close();
    } catch (Exception e) {
    if (pStmt != null) {
    try {
    pStmt.close();
    } catch (Exception e) {
    if (conn != null) {
    try {
    conn.close();
    } catch (Exception e) {
    and the batch file I use to start:
    @setlocal
    @echo off
    rem $Id: runBlobTest.bat,v 1.2 2005/04/21 15:06:22 hauser Exp $
    set classpath=../WEB-INF/classes;../WEB-INF/lib/ojdbc14.jar;
    echo JAVA_HOME: %JAVA_HOME%
    set JAVA_HOME=C:\PROGRA~1\Java\j2re1.4.1_02\
    echo classpath: %classpath%
    set javaCmd=C:\PROGRA~1\Java\j2re1.4.1_02\bin\java
    %javaCmd% -version
    %javaCmd% BlobTest "oracle" "oracle:thin://@ORADB.yourdomain.COM:1521:t300" "username" "password" "C:\Temp\veryLargeFile.pdf"
    endlocal

    Apparently, this is partially known - with a different stacktrace though:
    <<From: Oracle, Anupama Srinivasan 25-Apr-05 07:15
    Can you please check on Bug:4083226?
    Using the RETURNING Clause is not supported with JDBC. You could embed the statement in PL/SQL Block as in Metalink Note 124268.1 - JDBC Support for DML Returning Clause.
    The Enhancement Request filed on this issue is being considered for Release 10.2
    >>
    And my answer to it.
    Using the RETURNING Clause is not supported with JDBC.This is strange, with just "emptyblob()", it DOES work.
    I guess, our work-around that hopefully is more portable than embedding a "PL/SQL Block" will be to
    1) create the record with an empty blob,
    2) update the blob in a second statement (now, a RETURNING statement is no longer needed)

  • Error message when starting OC4J in JDeveloper 10.1.3.1

    Hello,
    I am new to Java Server Pages and OC4J. When I try to run a simple JSP page in JDeveloper 10.1.3.1, I get the following error message (edited):
    [Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
    ...\system\oracle.j2ee.10.1.3.39.84\embedded-oc4j\config>
    [waiting for the server to complete its initialization...]
    Error parsing internal-settings.xml: server-extension-provider class 'oracle.j2ee.ws.server.mgmt.runtime.InterceptorContainerExtension' not found
    oracle.classloader.util.AnnotatedClassNotFoundException:
         Missing class: oracle.j2ee.ws.server.codegen.ServerArtifactGenerator
         Depending class: com.evermind.server.ejb.compilation.Compilation
         Loader: oc4j:10.1.3
         Code-Source: ./j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar
    Diese Load wurde um system.root:0.0.0 mit der Methode Class.forName() eingeleitet.
    Die fehlende Klasse ist in keiner Code-Source oder keinem Loader in dem System verfügbar.
    at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2068) [./j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158]
         at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1679) [./j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [./j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [./j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@14916158]
         at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at java.lang.Class.forName0 (Native method) [unknown, by unknown]
         at java.lang.Class.forName (Class.java:242) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at com.evermind.server.ejb.compilation.Compilation.generateWebServiceRefs (Compilation.java:1541) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ejb.compilation.Compilation.compile (Compilation.java:189) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ejb.compilation.Compilation.doGenerateCode (Compilation.java:264) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ejb.EJBContainer.postInit (EJBContainer.java:898) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ApplicationStateRunning.initializeApplication (ApplicationStateRunning.java:217) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.Application.setConfig (Application.java:413) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.Application.setConfig (Application.java:314) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ApplicationServer.initializeSystemApplication (ApplicationServer.java:1557) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ApplicationServer.initializeAutoDeployedApplications (ApplicationServer.java:1544) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ApplicationServer.setConfig (ApplicationServer.java:974) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at com.evermind.server.ApplicationServerLauncher.run (ApplicationServerLauncher.java:131) [./j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in .\j2ee\home\oc4j.jar), by oc4j:10.1.3]
         at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap:1.5.0_06]
    Oracle Containers for J2EE 10g (10.1.3.1.0) initialized
    Any idea, what's wrong with my configuration?
    Thanks,
    Wolfgang

    Tested JSP page in JDeveloper 10.1.3.1; JSP page does not generate an error.
    Reinstall JDeveloper.

  • Error message when starting OC4J after deploying

    Hi, I hope someone can help me. I've been developing a J2EE project in JBuilder9 and OC4J 9.0.3. The problem occurs when starting OC4J after the application has been deployed. I'm using two MDBs and two Session Beans, one Stateless and the other one stateful. I'm using two topics with OJMS. I can access these topics from a standalone application, but when I try to lookup JNDI names from inside EJBs, I get a NamingException (name not found) Please I need some help
    OC4J error:
    D:\oc4j\j2ee\home>java -jar oc4j.jar
    Node started with id=678845146
    Error deploying file:/D:/oc4j/j2ee/home/applications/LogicaNegocio/LogicaNegocio
    .jar homes: Topic has empty subscription name
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized
    Error when executing standalone application client using EJBs:
    javax.naming.NameNotFoundException: No resource named 'TopicConnecionFactories/TablaTopics' found in resource provider 'BeanProcesamientoMensajes'
    This error doesn't appear when looking up that topic with a standalone application w/o using EJBs
    Thanks in advance.

    make sure the datasource.xml in the config directory is right
    for example
         <data-source
              class="com.evermind.sql.OrionCMTDataSource"
              name="OracleDS"
              location="jdbc/OracleCoreDS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="TopicConnecionFactories/TablaTopics"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="xx"
              password="xx"
              url="jdbc:oracle:thin:@172.16.113.2:1521:orcl"
              inactivity-timeout="90"
         />

  • Syntax error, insert "}" to complete Class body.

    Hello everyone,
    I am trying to create simple Adobe form with WebDynpro for java. Java error in autogenerated class appears "Syntax error, insert "}" to complete Class body". As I see, java class really corrupted - there are no "}" at the class end.
    Really appreciate any help.
    Kirill

    It dissappeared.

  • Error inserting acpi_cpufreq: Input/output error?

    Hi,
    I'm trying to set up frequency scaling on my Intel i5 760 as per the wiki.
    The only problem is I can't seem to load the acpi_cpufreq module!
    # modprobe acpi_cpufreq
    FATAL: Error inserting acpi_cpufreq (/lib/modules/2.6.39-ARCH/kernel/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.ko.gz): Input/output error
    There is no additional output in dmesg from this error.
    I'm running x86_64 btw, and I notice that it's trying to load an x86 module, could this have anything to do with it?
    Thanks!

    Hi
    Did you find a solution? I'm having exactly the same problem with acpi-cpufreq. (eeepc 900). I tried modprobing the p4_clockmod as well, which some older posts say is required for my machine, but I got the same error.
    Both modules appear to be available -
    ls /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq/
    acpi-cpufreq.ko.gz     gx-suspmod.ko.gz  mperf.ko.gz        powernow-k6.ko.gz  speedstep-ich.ko.gz
    cpufreq-nforce2.ko.gz  longhaul.ko.gz    p4-clockmod.ko.gz  powernow-k7.ko.gz  speedstep-lib.ko.gz
    e_powersaver.ko.gz     longrun.ko.gz     pcc-cpufreq.ko.gz  powernow-k8.ko.gz  speedstep-smi.ko.gz
    Last edited by belbo (2011-06-11 11:07:50)

  • Inserting blob data into database

    Hello everybody,
    I need insert blob data into database. that data i need to get from form
    can i use request.getParameter(""); for getting that file.
    Plz help how to get data from form to servlet and through callablestatement i need to insert into database.
    regards,
    Anil

    Hi,
    1) first create a form with file element
    first.jsp
    <form action="GetData" enctype="multipart/form-data" method="post">
    <input type="file" name="datafile" size="40">
    <input type="submit" value="Send">
    <input type="reset" name="Reset" value="Cancel">
    </form>
    GetData.java
    // servlet file
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    res.setContentType("text/html");
    PrintWriter out = response.getWriter();
    try {
    System.setProperty( "jdbc.drivers", "com.microsoft.jdbc.sqlserver.SQLServerDriver" );
    Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver" );
    con = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=JAVATEAM;SelectMethod=cursor;User=sa;Password=urpassword" );
    PreparedStatement pst = con.prepareStatement("insert into uploads(binaryfile) values(?)");
    FileInputStream fis=new FileInputStream(request.getParameter ( "datafile" ) );
    byte[] b= new byte[fis.available()+1];
    fis.read(b);
    pst.setBytes(1,b);
    pst.executeUpdate();
    pst.close();
    con.close();
    catch(SQLException e)
    out.println ( e);
    catch (ClassNotFoundException e)
    out.println( e );
    }Here in doPost(), i create preparedstatement,
    now you to create one procedure for insert
    and by using callable statement you just call that procedure and pass this byte b as arguments,
    now its in your hands
    my idea is over.

  • Error inserting data into database

    Hello I am having error inserting data into database through a servlet.Please I am very new to Java Technology and need your immediate help. beloww is the codea nd the error
    Apache Tomcat/4.0.3
    ERROR: Problems with adding new entry
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6106)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:2525)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:337)
         at Register.insertIntoDB(Register.java:71)
         at Register.doPost(Register.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         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:2343)
         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:1012)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
         at java.lang.Thread.run(Thread.java:536)
    COde:
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class Register extends HttpServlet
         public static Statement statement;
         private Connection DBConn;
         public void init(ServletConfig config) throws ServletException
              super.init(config);
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   DBConn=DriverManager.getConnection("jdbc:odbc:Challenge");
              catch(Exception e) {
                   e.printStackTrace();
                   DBConn=null;
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException
                   String user_id,FirstName,LastName, Email, Login, Password;
              FirstName = req.getParameter("FirstName");
              LastName = req.getParameter("LastName");
              Email = req.getParameter("Email");
              Login = req.getParameter("Login");
              Password = req.getParameter("Password");
              PrintWriter output = res.getWriter();
              res.setContentType("text/html");
              if (user_id.equals("")||
              FirstName.equals("") ||
                   LastName.equals("") ||
                   Email.equals("") ||
                   Login.equals("") ||
                   Password.equals(""))
                        output.println("<H3>Please click back " + "button and fill in all " + "fileds.</H3>");
                        output.close();
                        return;
                   boolean success = insertIntoDB("'" + FirstName + "','" + LastName + "','" + Email + "','" + Login + "','" + Password + "'");
                   if (success)
                        output.print("<H2>Thank You " + FirstName + " for registering.</H2>");
                        res.sendRedirect("file:///Register.html");
                   else
                        output.print("<H2>An error occured. " + "Please try again later.</H2>");
                        output.close();
              private boolean insertIntoDB(String stringtoinsert)
                   try
                        statement = DBConn.createStatement();
                        statement.execute("INSERT INTO Users(user_id,FirstName,LastName,Email,Login,Password) values (" + stringtoinsert + ");");
                        statement.close();
                   catch (Exception e)
                        System.err.println("ERROR: Problems with adding new entry");
                        e.printStackTrace();
                        return false;
                   return true;
              public void destroy()
                   try
                        DBConn.close();
                   catch(Exception e)
                        System.err.println("Problem closing the database");
    Your Help will be very much appreciate.I am using SQL Server database

    The error concerns these two lines:
    boolean success = insertIntoDB("'" + FirstName + "','" + LastName + "','" + Email + "','" + Login + "','" + Password + "'");
    statement.execute("INSERT INTO Users(user_id,FirstName,LastName,Email,Login,Password) values (" + stringtoinsert + ");");
    In the first line above, you have a string which represents the VALUES which you are inserting. There are 5 values. However in the second line above this is your actual SQL execution you are specifying 6 columns of data. If the column "user_id" is an identity or auto-incrementing field in the database, just remove it from this line. If not then you need to supply the "UserID" into the VALUES.
    This should fix the problem.

  • Inserting Blob in PL/SQL using select from other table

    Oracle 11.1.7.0:
    I am trying to insert blob column as defined below but not able to. Is this the right way of inserting blobs?
    set serveroutput on
    spool a.dat
    DECLARE
    BEGIN
      for i in 1..2
      loop
         for j in  (select r_payload                      
                       from fp_data where payload_id=331525112)
         loop
           EXECUTE IMMEDIATE 'insert into fp_data (r_payload) values ( ' || j.r_payload || ')';
        end loop;
      end loop;
      rollback;
    END;
    exit;

    BLOB work same a CLOB
    SQL> @clob
    SQL> drop table toto;
    SQL> create table toto (
      2    A  VARCHAR2 (30)  NOT NULL,
      3    B  VARCHAR2 (30)  NOT NULL,
      4    C  clob default empty_clob()
      5  )
      6        lob(c) store as toto_name_lo(disable storage in row)
      7  ;
    SQL>
    SQL> set feedback off
    SQL> set timing on;
    SQL> prompt
    SQL> prompt Insert lob with enabled storage in row:
    Insert lob with enabled storage in row:
    SQL> insert into toto (a, b, c)
      2  select owner a, object_name b, owner || ' ' || object_name c from all_objects
      3  where rownum < 10
      4  ;
    Elapsed: 00:00:00.51
    SQL> set timing off;
    SQL> select a,b from toto;
    A                      B
    SYS                      ICOL$
    SYS                      I_USER1
    SYS                      CON$
    SYS                      UNDO$
    SYS                      C_COBJ#
    SYS                      I_OBJ#
    SYS                      PROXY_ROLE_DATA$
    A                      B
    SYS                      I_IND1
    SYS                      I_CDEF2
    SQL> drop   table fp_data;
    SQL> create table fp_data (r_payload clob);
    SQL> insert into fp_data select c from toto where a = 'SYS'     AND B = 'I_IND1';
    SQL> select count(*) from fp_data;
      COUNT(*)
          1no need for PL/SQL

  • Internal error - insert in sorted tabl ZADRU with

    Hello Experts,
    While i open BP transaction for one of the business partner. We are getting the following error:
    *Internal error - insert in sorted tabl ZADRU with*.
    Request your help to resolve this issue. Do we have some SAP note to handle such scenarios. It seems the data has become inconsistent.
    Thanks,
    Rohit

    Hi, Rohit
    Table ZADRU - it's your own development, please ask abap-team about this table.
    Denis

  • [help!] Syntax error, insert "AssignmentOperator ArrayInitializer"...

    <%
      String USERNAME = (String)session.getAttribute("USERNAME");
        String myBlogUrl;
         if (USERNAME==null){                    
                  session.setAttribute("loginStatus","Not Logged In");//status: user NOT logged in              
                  myBlogUrl = "loginFail.jsp";
           esle {
                 myBlogUrl = "blog.jsp?username="+USERNAME;
        %>
        <ul>
          <li><a href="<%=myBlogUrl%>">My Blog</a></li>
    ...(navbar.jsp)
    1. I include masthead.jsp and navbar.jsp in a few other .jsp files using:
    <%@ include file="include/navbar.jsp" %>2. USERNAME is also declared in masthead.jsp:
    String USERNAME = (String)session.getAttribute("USERNAME");
    Tomcat gives an exception message as follows:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 11 in the jsp file: /include/navbar.jsp
    Generated servlet error:
    Syntax error, insert ";" to complete Statement
    An error occurred at line: 11 in the jsp file: /include/navbar.jsp
    Generated servlet error:
    Syntax error, insert[b] "AssignmentOperator ArrayInitializer" to complete ArrayInitializerAssignement
    3. I guesses there might be the problem with String USERNAME = (String)session.getAttribute("USERNAME");, so I deleted from navbar.jsp, but the problem still exists.
    So, this means there is some syntax problem with the statements in navbar.jsp? how can I solve the problem?

    Can't see anything wrong in the code you have posted.
    Error: AssignmentOperator ArrayInitializer
    The error message would lead me to look for any arrays you are declaring in your code. Are you declaring an array? Are you trying to initialize it? Have you closed all quotes/brackets etc etc?

  • Syntax error, insert "AssignmentOperator Expression" to complete Expression

    Hi experts,
    I am very new in Java. Currently, I get stuck in the exception of program. Please help me figure out what is the issue. The eclipse raises the error "Syntax error, insert "AssignmentOperator Expression" to complete Expression" at the command "exception;" as below code.
    Thanks,
    Hieu
    Edited by: user122479 on Apr 5, 2013 4:23 PM

    user122479 wrote:
    I put { code } as your advice, but it is still error.You put the tage in your *.java file?
    Oh dear!
    I think you should  take a few days to go trough the Java tutorials
    http://docs.oracle.com/javase/tutorial/ starting at "Trails Covering the Basics"
    Then you should find a tutorial on your IDE to learn how to import a project.
    Programming is a craft.
    And as with any craft you need some knowledge on your matter and training on your tools.
    A forum is not the right place to gather either one.
    bye
    TPD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Syntax error, insert ";" to complete LocalVariableDeclarationStatement

    I'm fairly new at JSP, and am trying to convert an ASP site to JSP.
    On most of my pages I get an error:
    An error occurred at line: 1 in the jsp file: /sheep.jsp
    Generated servlet error:
    Syntax error, insert ";" to complete LocalVariableDeclarationStatement
    An error occurred at line: 1 in the jsp file: /sheep.jsp
    Generated servlet error:
    Syntax error, insert ")" to complete MethodInvocation
    But the only thing on line 1 is <%

    Check the block of code between <% and %>
    Look for any semicolons you missed.
    Look for any brackets you missed closing.
    It might not be on line 1, but it will probably be in that area.

  • Error inserting Web Dynpro Script

    Hello Word,
    I have a problem when I try to insert the web dynpro script, sends a messages "Error inserting Web Dynpro Script",  any idea?
    sorry about my english
    Christian..

    Chintan Virani, Thaks for the answer
    The Disigner version is 7.1 (ALD 7.1),  I am trying to create Interective Forms with Web Dynpro in ABAP.
    I read in some palce that upgrading the sap GUI resolve the problem but I have the 710 version sap GUI (I suppose it's the last version) but this do not resolve the problem.
    can you help me please, thaks
    Christian

Maybe you are looking for

  • NV-DA 1 PAL MiniDV camera uncompatible with FCP 5?

    Hello, I've been trying to use my Panasonic NV-DA 1 PAL Mini DV camera with Final Cut Pro 5 on my Mac Powerbook and it is not recognizing the camera. Is this 1999 model camera uncompatible now with Final Cut Pro 5 for some reason and why? The camera

  • I get an error when I try to move instances of public folders.

    We have exchange 2003 and exchange 2010 setup in a coexistence environment. I get an error when I try to move instances of public folders from Exchange 2003 to Exchange 2010. "Unable to create the required MAPI profile. Please verify that you have su

  • MQC: Steps and Prerequiste to Execute

    greetings..                   i am new to PP-PI master recipe. I read the SAP help for material calculation but til i need some more clarification for my requirement i am using Active ingredient for making dome chemical . BOM  structure contain one A

  • Trial Photoshop CS6 - can I access it as a first-time user?

    I downloaded trial Photoshop CS6 on my iMac as a first-time user, knowing that my serial number for CS1 was out of date (I'm retired and haven't used Photoshop for years). But I can't activate it. Is it not available for first-time users and if not,

  • UCM security issue

    Hi, How to avoid the user input the idocs script in the contribution data file. I input the Idoc script as the contributor and it is executed. The user should not be able to input the Idoc script. Thanks!