BLOB insertion in Oracle 10g database using ojdbc14 (10g drivers)

Hello!
I have a situation where I am trying to insert a blob data into oracle 10g database using oracle thin
10g drivers, <b>ojdbc14.jar</b> in <b>weblogic 8.1 sp2</b>. I have the following error happening very intermittently.
<u><b>java.sql.SQLException: OALL8 is in an inconsistent state.</b></u>
And this is leading to the <u><b>"No more data to read from socket"</b></u> error when I am trying to
insert the BLOB into the database. I have gone through the bug list of SP2 and have realised there is the
following issue fixed in SP3.
<b>CR124933</b>
<b>An Oracle BLOB sometimes used a pooled connection after the connection pool determined that
the connection was available for reassignment.
Code was added to ensure the BLOB is completely processed before closing the pool connection or
ending the transaction.</b>
I believe the problem arises when we try to insert BLOB into database using a refreshed connection
from the pool.We have upgraded weblogic 8.1 from SP2 to SP4 service pack inorder to come over the above problem.
But this still continues to behave intermittently.
We put ojdbc14.jar in our classpath and Weblogic startup classpath looks like the following :-
WLS_CLASSPATH=${WLS_DOMAIN_DIR}/appslib/server.jar:$PRE_CLASSPATH:${WLS_WEBLOGIC_HOME}/server/lib/weblogic.jar:
${WLS_WEBLOGIC_HOME}/server/lib/ojdbc14.jar:${WLS_WEBLOGIC_HOME}/server/lib:${WLS_JAVA_HOME}/lib/tools.jar:
${WLS_JAVA_HOME}/jre/lib/rt.jar:${WLS_WEBLOGIC_HOME}/server/lib/webservices.jar:${WLS_CONFIG_DIR}:
${WLS_CUSTLIB_DIR}:${WLS_BIN_DIR}:$POST_CLASSPATH
export WLS_CLASSPATH
CLASSPATH=${WLS_CLASSPATH}:${APP_CLASSPATH}
export CLASSPATH
After upgrade to SP4, there are new ojdbc14_g.jar(debug jar) and orai18n.jar jars in the ${WLS_WEBLOGIC_HOME}/server/ext/jdbc/oracle/10g directory added.
Please let me know if I need to update classpath with the new 10g jars in the ext/lib directory or any suggestions
to insert BLOB using the ojdbc14 10G drivers, Weblogic 8.1 environment would be appreciated.
Following is the stack trace of the errors that I recieve:
<Oct 6, 2005 1:29:36 PM EDT> <Error> <JDBC> <BEA-001112> <Test "select count(*) from DUAL" set up for pool
"MHUBPoolStage" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state".>
<Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "MHUBPoolStage" closed.>
<Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001067> <Connection for pool "MHUBPoolStage" refreshed.>
<Oct 6, 2005 1:29:36 PM EDT> <Info> <EJB> <BEA-010051>
java.rmi.RemoteException: TransactionRequestManager.requestTransaction():
Caught PersistnceException com.mortgagehub.busobj.PersistenceException: -5258: No more data to read from socket
Please let me know if there is anything that I am missing.
Thanks
Pradeep G

pradeep g wrote:
Hello!
I have a situation where I am trying to insert a blob data into oracle 10g database using oracle thin
10g drivers, <b>ojdbc14.jar</b> in <b>weblogic 8.1 sp2</b>. I have the following error happening very intermittently.
> <u><b>java.sql.SQLException: OALL8 is in an inconsistent state.</b></u>
And this is leading to the <u><b>"No more data to read from socket"</b></u> error when I am trying to
insert the BLOB into the database. I have gone through the bug list of SP2 and have realised there is the
following issue fixed in SP3.
> <b>CR124933</b>
<b>An Oracle BLOB sometimes used a pooled connection after the connection pool determined that
the connection was available for reassignment.
Code was added to ensure the BLOB is completely processed before closing the pool connection or
ending the transaction.</b>
> I believe the problem arises when we try to insert BLOB into database using a refreshed connection
from the pool.We have upgraded weblogic 8.1 from SP2 to SP4 service pack inorder to come over the above problem.
But this still continues to behave intermittently.
We put ojdbc14.jar in our classpath and Weblogic startup classpath looks like the following :-
> WLS_CLASSPATH=${WLS_DOMAIN_DIR}/appslib/server.jar:$PRE_CLASSPATH:${WLS_WEBLOGIC_HOME}/server/lib/weblogic.jar:
${WLS_WEBLOGIC_HOME}/server/lib/ojdbc14.jar:${WLS_WEBLOGIC_HOME}/server/lib:${WLS_JAVA_HOME}/lib/tools.jar:
${WLS_JAVA_HOME}/jre/lib/rt.jar:${WLS_WEBLOGIC_HOME}/server/lib/webservices.jar:${WLS_CONFIG_DIR}:
${WLS_CUSTLIB_DIR}:${WLS_BIN_DIR}:$POST_CLASSPATH
export WLS_CLASSPATH
CLASSPATH=${WLS_CLASSPATH}:${APP_CLASSPATH}
export CLASSPATH
> After upgrade to SP4, there are new ojdbc14_g.jar(debug jar) and orai18n.jar jars in the ${WLS_WEBLOGIC_HOME}/server/ext/jdbc/oracle/10g directory added.
> Please let me know if I need to update classpath with the new 10g jars in the ext/lib directory or any suggestions
to insert BLOB using the ojdbc14 10G drivers, Weblogic 8.1 environment would be appreciated.
> Following is the stack trace of the errors that I recieve:
> <Oct 6, 2005 1:29:36 PM EDT> <Error> <JDBC> <BEA-001112> <Test "select count(*) from DUAL" set up for pool
"MHUBPoolStage" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state".>
<Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "MHUBPoolStage" closed.>
<Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001067> <Connection for pool "MHUBPoolStage" refreshed.>
<Oct 6, 2005 1:29:36 PM EDT> <Info> <EJB> <BEA-010051>
java.rmi.RemoteException: TransactionRequestManager.requestTransaction():
Caught PersistnceException com.mortgagehub.busobj.PersistenceException: -5258: No more data to read from socket
Please let me know if there is anything that I am missing.
> Thanks
> Pradeep GHi. This is something we'd like to diagnose. How is your application
getting using and closing pool connections? The initial symptom
seems to be an internal oracle problem... Are you using standard
JDBC or oracle-specific calls?
Joe

Similar Messages

  • How to eliminate inserting  Duplicate rows into database using JDBC Adapter

    File->Xi->JDBC
    In above Scenario if the file has two rows their values are identical, then how can we eliminated inserting  Duplicate rows into database using JDBC Adapter

    Database is a consumer of a SERVICE (SOA!!!!!!).
    Database plays a business system role here!!!!
    Mapping is part of an ESB service
    Adaptor is a technology adapted to ESB framework to support specific protocol.
    ESB accomplish ESB duties such as transformation, translation, routing. Routing use a protocol accepted by the consumer. In a JDBC consumer it is JDBC protocol and hence it a JDBC adaptor.
    There is clear separation on responsibilities among business system and ESB. ESB do not participate in business decision or try to get into business system data layer.
    So who ever are asking people to check duplicate check as part of mapping (an ESB service) may not understand integration practice.
    Please use an adaptor module which will execute the duplicate check with business system in a plug and play approach and separate that from ESB service so that people can build integration using AGILE approach.
    Thanks

  • How do you query Oracle RDF database using Java program?

    Does anyone know how to get data out of the oracle RDF database using Java?
    I'm running the following java code and it returns basically null values. My guess is that the get_triple() function returns a dataset other than resultset. I've tried searching the Oracle web site. Am I supposed to be using CLOB object? Any help would be appreciated. Thanks
    sql = "SELECT a.triple.GET_TRIPLE() AS triple FROM family_rdf_data a";
    ResultSet rs = stmt.executeQuery( sql ) ;
    while ( rs.next() )
    System.out.println( rs.getString(1) ) ;
    rs.close() ;

    get_triple() returns an object, and the code would be different from the code of retrieving a string. Some sample code for retrieving objects is at http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.html
    get_subject(), get_property() return strings so the code below should work. get_object() returns a CLOB so different handling would be required and there is some sample code at the link above.
    Melli

  • BLOB insert behavior with thin driver using standard JDBC2.0 and ORACLE-JDBC2.0API

    We have a problem with a BLOB insert to an oracle 8.1.7 DB using Oracle 8.1.7 JDBC thin driver.We get socket read/write error after inserting 32k of data using the standard JDBC2.0 API but using the Oracle JDBC2.0API (using OracleResultSet) it goes fine. We have a requirement to use the standard JDBC2.0 so that our code works with multiple database vendors. Is there another way to get in the blob data with standard JDBC API & using thin driver...?
    thanks,
    Madhu
    Here is my sample test program that does both standard & oracle specific JDBC Blob test insert.
    import java.sql.*;
    import java.io.*;
    import oracle.sql.BLOB;
    import oracle.jdbc.driver.OracleResultSet;
    public class testBLOB {
    //trying to insert a huge file to a BLOB
    static String fileName = "/kernel/genunix";
    public static void main(String[] args) {
    String driverName = "oracle.jdbc.driver.OracleDriver";
    String dbURL = "jdbc:oracle:thin:@localhost:1521:test"; //thin driver
    String user = "BlobTest";
    String passwd = "BlobTest";
    Connection con=null;
    try {
    Class.forName(driverName);
    con=DriverManager.getConnection(dbURL, user,passwd);
    catch (Exception e) {
    e.printStackTrace();
    close(con);
    int i = 0;
    while (i < args.length) {
    if (args.equals("-f"))
    fileName = args[++i];
    i++;
    System.out.println("The file being Stored is: "+fileName);
    createTable(con);
    insertUsingOracleAPI(con);
    insertUsingJDBC20API(con);
    //readDB(con);
    static String getFileName() {
    return fileName;
    public static void close(Connection con) {
    try {
    if (con != null) {
    con.close();
    catch (Exception e) {
    System.exit(-1);
    public static void createTable(Connection con) {
    Statement stmt ;
    try {
    stmt = con.createStatement();
    stmt.execute("DROP TABLE basic_blob_table");
    stmt.close();
    catch (SQLException sqlEx) {
    System.out.println("Dropped the Table");
    try {
    stmt = con.createStatement();
    stmt.execute("CREATE TABLE basic_blob_table ( x varchar2(30), b blob)");
    stmt.close();
    catch (SQLException sqlEx) {
    sqlEx.printStackTrace();
    close(con);
    System.out.println("Created the Table");
    public static void insertUsingOracleAPI(Connection con) {
    OutputStream os = null;
    Statement stmt = null;
    ResultSet rs = null;
    FileInputStream is = null;
    try {
    con.setAutoCommit(false);
    stmt = con.createStatement();
    stmt.execute("INSERT INTO basic_blob_table VALUES( 'OracleAPI', empty_blob())");
    System.out.println("Inserted the dummy Row");
    rs = stmt.executeQuery("Select * from basic_blob_table where x='OracleAPI'");
    if (rs != null && rs.next()) {
    BLOB blob = ((OracleResultSet)rs).getBLOB(2);
    File file = new File(getFileName());
    is = new FileInputStream(file);
    os = blob.getBinaryOutputStream();
    byte[] chunk = new byte[1024];
    int length = -1;
    while((length = is.read(chunk)) != -1)
    os.write(chunk, 0,length);
    System.out.println("Inserted the File " + getFileName() );
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    if (os != null) {
    os.flush();
    os.close();
    if (is != null)
    is.close();
    stmt.close();
    con.commit();
    con.setAutoCommit(true);
    catch (Exception e) {}
    public static void insertUsingJDBC20API(Connection con) {
    PreparedStatement stmt = null;
    FileInputStream is = null;
    try {
    stmt = con.prepareStatement("INSERT INTO basic_blob_table VALUES(?,?)");
    File file = new File(getFileName());
    is = new FileInputStream(file);
    stmt.setString(1,"JDBC20API");
    stmt.setBinaryStream(2,is,(int)file.length());
    stmt.executeUpdate();
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    if (is != null)
    is.close();
    stmt.close();
    catch (Exception e) {}
    null

    Thanks for the response.
    I understand what you are saying...
    that readers don't block writers in Oracle (the same is true in SQL Server 2000).
    However, I don't see how my test case is working correctly with Oracle (the exact same code acting as I'm thinking it should with SQL Server, but I still think it is acting incorrectly with Oracle).
    I have transaction A do this:
    update <table> set <column2>=<value> where <column1>='1'
    then I use Thread.sleep() to make that program hang around for a few minutes.
    Meanwhile I sneak off and start another program which begins transaction B. I have transaction B do this:
    select * from <table> where <column1>='1'
    and the read works immediately (no blocking... just as you have said) however, transaction A is still sleeping, it has not called commit() or rollback() yet.
    So what if transaction A were to call rollback(), the value read by transaction B would be incorrect wouldn't it ?
    Both A and B use setAutoCommit(false) to start their transactions, and then call setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED).
    Isn't that supposed to guarantee that a reader can only read what is committed ?
    And if a row is in "flux"... in the process of having one or more values changed, then the database cannot say what the value will be ?
    I can almost see what you are saying.
    In letting the reader have what it wants without making it wait, I suppose it could be said that Oracle is holding true to the "only let committed data be read"
    So if that's it, then what if I want the blocking ?
    I want an entire row to be locked until whoever it in the middle of updating, adding, or removing it has finished.
    Do you know if that can be done with Oracle ? And how ?
    Thanks again for helping me.

  • Unable to connect Oracle Application Database using Discoverer Admin 10g

    Hi,
    I have installed oracle Admin 10g on my machine and trying to connect oracle application database but every time i am getting error like "Unable to connect to: user@hostname Failed to connect to database Unable to connect to Oracle Application Database. Invalid username/password".
    Installed BI Discoverer Admin 10.1.2.1
    Discoverer Admin Client 10.1.2.48.18
    Database 9i
    I have done following steps:
    1. Selected radio button for Connect to Application EUL's.
    2.Gateway User ID (GWYUID)/Password :APPLSYSPUB/PUB
    3.FNDNAME:APPS
    I able to connect discoverer plus.
    Thanks
    Ravi

    Hi Ravi
    Glad to hear you solved this. It is very gratifying when one solves it alone, don't you think?
    Best wishes
    Michael

  • How to store txt file into Oracle 7 Database using Pro*C

    Hi,
    I want to store a txt file into Oracle 7 database table using
    Pro*C application. But do not know what type of column to use.
    At first glance it appeared to me as LONG can serve the purpose
    but later I noticed that I can not do the sequential read/write
    in LONG type of column. That is, I have to use chunks of max of
    2GB (or file lenght) to read/write into such columns.
    I want something simiar to CLOB of Oracle 8.
    I would appreciate if you can provide me solution.
    Thanks,
    Anurag

    You store images in a BLOB column in the database.
    However, inserting image in that column and displaying data/image from that column are 2 very different tasks.
    If you are using Oracle forms, displaying is easy. Default block sitting on the table with BLOB column, can be easily mapped to image box (or similar control), which will display that image.
    Inserting images will be a different ball game. If your forms are web based (i.e. run from browser) and you want to insert images from client machine, some special arrangements are required.
    If images are on database server and you want to insert them in database, the stored procedure given in the earlier thread (posted above) will do the job.

  • Cannot connect to Oracle express database using Oracle forms 10 on win XP

    Hello All,
    I have installed Oracle Developer Suite 10g along with Oracle Express edition database on Windows XP home edition. (Do get successful installation message)
    When i open up Forms builder and try to use connect option- it comes up with user name, password and database dialogue box?
    If I enter user name and password I choose while installation express edition database it comes up with the following error:
    "ORA-12560:TNS:protocol adapter error"
    Have checked the services and they all seem to be running, have tried deinstalling/installing by removing registry values but still no luck.
    In fact what ever I type the error message remains the same.
    On the other hand I can access Express edition database using user name and password I choose during its installation.
    Can any one please reply me what details i need to enter here? Is it same as I set up during express edition database installation? What about database?
    Please help. As I am struggling big time.
    Thanks in advance.

    You may be having the same problem as this guy:
    Forms 6i - ora-012203 tns:unable to connect to the destination
    You need to start SQL Plus and see if you can log in, too, to make sure there are not other problems.
    What are you using for the Database name (the third entry following username and password)?

  • Inserting a record in database using Java

    Hello All,
    i have connected a Java Application to the SAP BO Database using DI API and would like to insert a record in the demo database without using an SQL Query "Insert into table1...." but using the following snippet though i dont know if am using the right classes :
                                    ICompany company = conn.getCompany();
                                     IItems items = SBOCOMUtil.newItems(company);
                        items.setItemCode("124");
                        items.setItemName("VXC");
                        items.setItemsGroupCode(1);
                        items.setItemType(0);
                        items.add();
    What i am trying to do here is insert a new record but i dont know where i should mention the table name for e.g. there is table called OITM in the demo database from BO where i would like to create a new Item.
    Could anyone help me here.
    Regards,
    Amit Hingher

    Hi Amit,
    You don't need to reference the destination tables as there is a class for each data object in the DI API and the data tables associated with the object are hardcoded in the class.
    The Items class is the correct one for adding item master data (ie data in OITM, OITW etc).
    I'm not very familiar with these Java objects but I think the add method should return an integer value (as it does with the COM objects used by .NET). If the return value is zero then the add was successful. If the add failed then you'll get a non-zero value which is the SBO error code.
    Kind Regards,
    Owen

  • Cloning a 10g Database using DBCA and templates

    I have created a template from a 10G database (structure and data) and want to use this template and data to create a clone of the database on another server using the DBCA on the standby server. Where does DBCA ask for the names of the templates of my clone database? It seems to only have templates for its pre-existing databases (wharehouse, general purpose, custom, etc.).

    Thanks. I figured this out on my own and seems work fine. My problem is I am connected over a Window network domain and the transfer speed is very slow. I finally had to kill the job and manually move the critical control, init, redo, and data files that DBCA missed. I also had to use the DBCA again to create the EM DBconsole server as well as copy over the, initPROD.ora file as well as the tnsnames.ora, listener.ora and sqlnet.ora files over to the $ORACLE_HOME/Network/Admin directory. SPFILE was create using create spfile command, I had to perform a recover database once in the initial startup of the database clone.
    If I do this operation again I will move datafiles and DBCA template components from the server to a USB SCCI Drive connected locally to the source server then connect this remote disk to the target server rather than transfer files over a domain network.
    Any other tips that anyone can over on cloning a database using DBCA in 10G please let me know any things to avoid, traps, bugs, best practices would be greatly appreciated.
    RR.

  • Error upon inserting data in sql Database using stream analytics job: Datatye error conversion

    I have a data passed into the Event Hubs, queried by stream analytic job inserting it into sql database. Upon running the job, it becomes idle a few seconds after since it has an error:
    Message: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64. Exception message at level [1], exception number [0], parent exception number [0]: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    The data type in one of my field(IsHistorical) is Boolean with a value of false. The data type of the column in the sql table where this is to be inserted is of type bit. In this case, it seems that stream analytics could not convert the value "false"
    into a bit data type when inserting in sql table.
    I'm wondering if you already have encountered this problem. Could you help me resolve this problem?
    Thank you.

    Azure Stream Analytics does not have Boolean type. On input we will convert JSON Boolean value to bigint.
    Here is the list of supported types and conversions:
    https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx 
    You  can fix this erro by changing column type from bit to int in SQL table schema.

  • I m not getting connected to oracle 9i database using my ejb...

    hi i have made a simple ejb which simply connects to a database of oracle 9i using a datasource on oracle 10g application server...but now my problem is that when i am trying to deploy the ejb ..it is not getting deployed...it shows the following error..
    Deployment failed:nested exception
    resolution:
    base exception:
    com.evermind.server.rmi.OrionRemoteException
    Disconnected:Connection reset. Disconnected:Connection reset.
    the code i am using for EJB class is as follows
    package Simpapp;
    import javax.ejb.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.sql.DataSource;
    public class SimpappBean implements SessionBean {
        static final String DATASOURCE = "bajaj";
        static final String SQL = "select * from login ";
        DataSource ds;
        public String upper (String input) throws java.rmi.RemoteException {
         try {
             Connection conn = ds.getConnection ("bajaj10g","bajaj10g");
             Statement sql = conn.createStatement ();
             //sql.setString (1, input);
             ResultSet results = sql.executeQuery (SQL);
             if (results.next () == false) {
              System.out.println ("No rows for "+ input);
                  throw new java.rmi.RemoteException ("SQL failure");
             } // if
             String result = results.getString ("username");
             results.close ();
             sql.close ();
             conn.close ();
             if (result == null) {
              System.out.println ("NULL result for "+ input);
                  throw new java.rmi.RemoteException ("SQL failure");
             } else
              return (result);
         } catch (SQLException sqle) {
             System.err.println ("While executing SQL: " +
              sqle.getMessage ());
             throw new java.rmi.RemoteException ("SQL failure");
            } catch (Exception e) {
             System.err.println ("Unknown Exception: " +
              e.getMessage ());
             throw new java.rmi.RemoteException ("Bean Exception: " +
              e.getMessage ());
         } // catch
        } // simpapp
        public void ejbCreate () {
             try {
             Context ctx = new InitialContext ();
             ds = (DataSource) ctx.lookup (DATASOURCE);
         } catch (Exception e) {
             System.out.println ("While creating Bean " +
              e.getMessage ());
         } // catch
        } // ejbCreate
        public void ejbRemove () {}
        public void ejbActivate () {}
        public void ejbPassivate () {}
        public void setSessionContext (SessionContext ctx) {}
    } // SimpappBeancan any body suggest me where lies the problem???
    all my Home ,Remote classes are doing well when they are used for any other simple helloworld type of program

    Is that the only Oracle client installed? If you have another one hanging around it could be using the wrong tnsnames file.

  • Unable to connect to 10g database using Devloper 6i and SQLPLUS 8

    Dear all Developers,
    I have installed 10g with patch 10.2.0.3 and developer 6i, i am not able to access the database with Forms Devloper 6i, Report Devloper 6i and SQLPLUS 8 (installed by default with DS) when i try to initiate connection the sessions crashes. (DB character set AL32UTF8)
    Please note we already have ORACLE RAC 10g version 10.2.0.3 (DB character set AR8MSWIN1256) developer can connect to this db with no errors
    Please suggest how i can solve this problem
    Thanks
    Zeeshan Sheikh

    First of all you need to be on Patch set 18 of Oracle Forms 6i -- but I think you will still have problems with the character set you are using... but you'll need to search out details.

  • Lock-ups while inserting to a remote database using a dblink

    Our application runs across multiple instances of Oracle 8i - 8.1.6.
    Throughout the day we run some batch processes to transfer data across these instances using dblinks. Ocassionally the process locks up and further investigation shows that the server from which we are pushing information out seems to have executed an insert statement on a remote instance (insert into test_table@tst_dblink select * from local_table) and is waiting for a return from the remote server while the remote instance seems to be hanging too. Oracle does not return any error but simply waits forever for the statement to finish.
    If anybody has experienced this before can you please share any information you may have on 1. how to prevent this from happening or 2. How to make oracle give up on the transaction, roll it back and raise an error?
    Thanks a lot....

    Well, certainly we need more info to fix the problem! couple of "system states" on both the machines when the job is hanging would help. couple of "stack trace" of the shadow process will also help. please call local oracle support with the system state and stack trace.
    Sounds like the job is hanging on some resource (lock,enque,latch,io...). oracle doesn't give up for few resources, like waiting on ST,latch, io etc. we have to kill the offending process if we want!!
    just my 2 cents :)
    G

  • (inserting values into a database using a Checkbox) HELP!!!!!!!!!!!!!!!

    Can anyone help me out ???
    I am getting some trouble with using multiple check boxes to store the information in a database (MS ACESS)
    Each checkBox has multiple values in them.(3).
    1)Should they have similar names for each one?
    I am also getting an error saying cannot resolve symbol stating about pnumber,itemname,price
    Can you also tell me that if my query statements are correct??
    I want to insert into the database multiple values of each checkboxes which are checked.
    Thanks!!!!!!!
    <!---------------------------------------------html PART--------------------------------------------------------------------------------------->
         <form method="POST" action="http://localhost:8080/cvc/jsp/addCart.jsp">
              <table align = "center" border="2" width="50%">
              <TBODY>
    <%               
                   getProducts.next();
                   pnumber = getProducts.getInt(1); //this part works since I am seeing it displayed in a table
                   itemname = getProducts.getString(2);                         
                   price = getProducts.getFloat(3);
    %>               
                   <tr>               
                   <td><img align= "centre" border=0 src="http://localhost:8080/cvc/ASA Technologies\mp3.jpg" /></td><td><%=itemname%></td><td align="right"><%=price%></td>
                   <td align="center"><input type="checkbox" name="items" value="<%=pnumber+":"+itemname+":"+price+":"%>" </input></td> //????????????
    <!--------------------------------------JSP PART-------------------------------------------------------------------------------------------------------------------->
    <%@ page import="java.util.*, java.io.*, java.sql.*" %>
    <%
    String insert;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String sourceURL = new String("jdbc:odbc:ASA");
    Connection con = null;
    con = DriverManager.getConnection(sourceURL,"","");
    java.sql.Statement statement = con.createStatement();
    while ( request.getParameter("pnumber+itemname+price") !=null)
    insert = "insert into Cart VALUES( ' "+pnumber+" ' ," + " '"+itemname+ " ' ,"+ " ' "+price+ " ' )"; //getting the error here :cannot resolve symbols
    statement.executeUpdate(insert);
    %>

    Syntax of insert was wrong..
    while ( request.getParameter("pnumber+itemname+price") !=null)
    insert = "insert into Cart VALUES( ' "+pnumber+" ' ," + " '"+itemname+ " ' ,"+ " ' "+price+ " ' )"; //getting the error here :cannot resolve symbols
    statement.executeUpdate(insert);
    try this........
    Column1, Column2, Column3 are the field names of your table Cart....
    ..changed it to your original fieldnames...
    insert = "insert into Cart (Column1,Column2,Column3) VALUES( ' "+pnumber+" ' ," + " '"+itemname+ " ' ,"+ " ' "+price+ " ' )";

  • How to insert data into mysql database using GUI?

    HI there,
    I have created a GUI application using Netbeans 6.7.1 in which there are three jtextfields. Now from those text fields i have to insert data in the mysql database. I have already connected to mysql using drivers and URL which is used to connect to DB. So what code should i write in the source of these text fields. Please help me and give the code to it.
    I actually don't know what code to be written in the source of a text field.
    Thank You.

    Yo buddy i didn't mean that. I wanted to say that if you see my project then it will be easy for you to help me. okay have a look at this code and tell me i have just created my gui
    This is Main.java -->
    package bookdatabase2;
    import java.sql.*;
    import java.awt.*;
    import javax.swing.*;
    * @author Mohd Azeem
    public class Main {
    * @param args the command line arguments
    public static void main(String[] args)throws Exception {
    // TODO code application logic here
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","");
    //PreparedStatement state=con.prepareStatement("select * from titles");
    //ResultSet result=state.executeQuery();
    //while(result.next()){
    // System.out.println(result.getString(1)+" "+result.getString(2)+" "+result.getString(3)+" "+result.getString(4));
    This the gui i have created
    BookDatabase.java -->
    package my.bookdatabase;
    import java.sql.*;
    import javax.swing.*;
    public class BookDatabase extends javax.swing.JFrame {
    public BookDatabase()throws Exception {
    Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/books","root","");
    initComponents(); }
    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {                                           
    // TODO add your handling code here:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
    public static void main(String args[])throws Exception {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    try{
    new BookDatabase().setVisible(true);}
    catch(Exception e){}
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    // End of variables declaration
    Now tell me what to do?
    i have only created the gui but unable to run it
    when i click on run only main.java is being executed
    but bookdatabase.java is not getting executed?
    what should i do please help?

Maybe you are looking for

  • The Mystery Of Free Public WiFi

    Almost everywhere I travel, I see a Computer-to-Computer network listed call 'Free Public Wi-Fi'. Clearly that's not what it is (oh, and I can see it now, in some hotel in the armpit of Ohio), so I guess it must be some bizarre PC phenomenon that has

  • JVC Everio GZ-MG630 60GB Camcorder Compatibility with FCP

    I was wanting to get a little cheap & compact camcorder for carrying around and do away with tapes at the same time. Has anyone had any luck with FCP & hard drive camcorders with no tapes specifically the JVC Everio's? I have always been a miniDV use

  • Macrovision/DVD player TV-Out Issues

    I have certain newer DVD's which have Macrovision copy protection on them.  When I try to play the movie, I get the same message no matter which of the 5 DVD software decoders I use. "This DVD-Video content is protected by Macrovision.  This system d

  • Good (cheap) second monitor for 20"CD

    I am looking for a second (LCD) monitor for my 20" Core Duo. It doesn't need to be top of the line for video or photo editing or anything like that: I just want more real estate and want to take advantage of the Core Duo's ability to use extended des

  • Redo log backup on disk

    Hi I want to take Redo log backup on disk. what changes i have to made in init<SID>.sao file. Regards Vikram