SQLException on table name

Hi there,
In my database I have a table named PROSPECTS. One of the fields in that table is STATE_PROVINCE.
I have a method named getProspectInfo(...) which is supposed to return all the data on a given individual including the STATE_PROVINCE.
My SQL statement reads like this:
SELECT FIRSTNAME,LASTNAME,COMPANY,ADDRESS1,ADDRESS2,CITY,STATE_PROVINCE,COUNTRY,ZIP_PCODE,PHONE,EMAIL_ADDRESS FROM PROSPECTS WHERE ID=14;
However, in my method when I call
String temp = resultSet.getString("STATE_PR0VINCE");
I keep getting an SQLException that states it cannot find the column named STATE_PROVINCE. It doesn't have a problem with any of the other columns. What gives? STATE_PROVINCE DOES EXIST in the the PROSPECTS table! Why is it giving me such a hard time?
Here's the actual readout:
java.sql.SQLException: Column 'STATE_PR0VINCE' not found.
at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:2316)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:1822)
at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:224)
at mvcs.ManagerModel.getProspectInfo(ManagerModel.java:2442)
Please advise,
Alan

Is it just the font, or does the "O" in "STATE_PROVINCE" look like a zero ?
Ps. can you connect to the database using some database client ?
Eg. there's a free version of DBVisualizer, which lets you connect to any database via JDBC. So you can take that select statement and run it against the database yourself.
regards,
Owen

Similar Messages

  • Invalid table name "USERS" specified at position 21

    hi i'm getting this error when i try to execute sql statement like this:
    * @jc:sql statement="SELECT username FROM users WHERE username = {user}"
    public String checkLogin(String user) throws SQLException;
    and using it:
    try {
    String answer = shop.checkLogin(message1);
    } catch(SQLException ex) {
    ex.printStackTrace();
    the full exception is here:
    java.sql.SQLException: Invalid table name "USERS" specified at position 21.
    at com.pointbase.net.netJDBCPrimitives.handleResponse(Ljava.io.DataInput
    Stream;)V(Unknown Source)
    at com.pointbase.net.netJDBCPrimitives.handleJDBCObjectResponse(Ljava.io
    .DataInputStream;)I(Unknown Source)
    at com.pointbase.net.netJDBCConnection.prepareStatement(Ljava.lang.Strin
    g;)Ljava.sql.PreparedStatement;(Unknown Source)
    at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ZLjava.lang
    .String;II)Ljava.sql.Statement;(ConnectionEnv.java:1190)
    at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ZLjava
    .lang.String;II)Ljava.lang.Object;(ConnectionEnv.java:932)
    at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ZLjava
    .lang.String;)Ljava.lang.Object;(ConnectionEnv.java:920)
    at weblogic.jdbc.wrapper.Connection.prepareStatement(Ljava.lang.String;)
    Ljava.sql.PreparedStatement;(Connection.java:359)
    at weblogic.jdbc.wrapper.JTSConnection.prepareStatement(Ljava.lang.Strin
    g;)Ljava.sql.PreparedStatement;(JTSConnection.java:544)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(
    Ljava.lang.reflect.Method;[Ljava.lang.Object;ZLjava.lang.String;)Ljava.sql.Prepa
    redStatement;(DatabaseControlImpl.jcs:1676)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(Ljava.lan
    g.reflect.Method;[Ljava.lang.Object;)Ljava.lang.Object;(DatabaseControlImpl.jcs:
    2567)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(Ljava.lang.Obje
    ct;[Ljava.lang.Object;)Ljava.lang.Object;(DispMethod.java:377)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Ljava.lang.Object
    ;Ljava.lang.String;Lcom.bea.wlw.runtime.core.dispatcher.DispMethod;[Ljava.lang.O
    bject;)Ljava.lang.Object;(Invocable.java:423)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Lcom.bea.wlw.runt
    ime.core.dispatcher.DispMethod;[Ljava.lang.Object;)Ljava.lang.Object;(Invocable.
    java:396)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Lcom.bea.wlw.runt
    ime.core.request.Request;)Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(Inv
    ocable.java:248)
    at com.bea.wlw.runtime.jcs.container.JcsContainer.invoke(Lcom.bea.wlw.ru
    ntime.core.request.Request;)Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(J
    csContainer.java:85)
    at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(Lcom.bea.w
    lw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.dispatcher.InvokeResu
    lt;(BaseContainerBean.java:224)
    at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(Lcom.bea.wlw.r
    untime.core.request.Request;)Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;(
    SLSBContainerBean.java:103)
    at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(Lcom.bea.wlw.
    runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.dispatcher.InvokeResult;
    (StatelessContainer_ly05hg_ELOImpl.java:45)
    at com.bea.wlwgen.GenericStatelessSLSBContAdpt.invokeOnBean(Ljava.lang.O
    bject;Lcom.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.dispa
    tcher.InvokeResult;(GenericStatelessSLSBContAdpt.java:62)
    at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(Lcom.bea
    .wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(B
    aseDispatcherBean.java:153)
    at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(Lcom.bea.wlw.
    runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(BaseDi
    spatcherBean.java:54)
    at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(Lcom.bea.wlw.
    runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(SyncDi
    spatcherBean.java:168)
    at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(Lco
    m.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Respon
    se;(SyncDispatcher_k1mrl8_EOImpl.java:46)
    at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Lcom.be
    a.wlw.runtime.core.dispatcher.DispFile;Lcom.bea.wlw.runtime.core.request.Request
    ;)Lcom.bea.wlw.runtime.core.request.Response;(Dispatcher.java:161)
    at com.bea.wlw.runtime.core.dispatcher.ServiceHandleImpl.invoke(Lcom.bea
    .wlw.runtime.core.request.Request;)Ljava.lang.Object;(ServiceHandleImpl.java:436
    at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl._invoke(Lcom.bea.wlw
    .runtime.core.request.ExecRequest;)Ljava.lang.Object;(WlwProxyImpl.java:326)
    at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl.invoke(Ljava.lang.Ob
    ject;Ljava.lang.reflect.Method;[Ljava.lang.Object;)Ljava.lang.Object;(WlwProxyIm
    pl.java:315)
    at $Proxy16.sprawdzLogin(Ljava.lang.String;)Ljava.lang.String;(Unknown S
    ource)
    at shop.ShopController.Login(Lshop.ShopController$LoginForm;)Lcom.bea.wl
    w.netui.pageflow.Forward;(ShopController.jpf:111)
    at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.
    lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
            at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.l
    ang.Object;)Ljava.lang.Object;(Unknown Source)
            at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[
    Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
    can someone tell me why is this happening, i'm getting this error even though mysql server is shut down
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Is the users table is in pointbase db or sql server, in the exception it looks like it is looking up in pointbase db for users table. check you connection @jc:connection data-source-jndi-name of your database control.

  • Physical table name - abstract table name mapping in CMP Bean

    Hello,
    I am using a EJB 2.x bean deployed on a SJSAS 9 server. EJB has problem associating the EJB to the actual table
    Details are as follows:
    EJB name: AccountCMP
    Actual tablename : account
    Error
    ejb store called
    IM: postInvokeentity3.AccountBean145996470_ConcreteImpl@d6be89
    EJB5071: Some remote or transactional roll back exception occurred
    com.sun.jdo.api.persistence.support.JDODataStoreException: JDO76400: Got a JDBC SQLException while executing the SQL statement:
    insert into "ACCOUNTCMP"("DESCRIPTION", "ACCOUNTNAME", "BALANCE", "ACCID") values ( ?, ?, ?, ?).
    Please examine the SQLException for more information.
    NestedException: java.sql.SQLException: ORA-00942: table or view does not exist
    FailedObjectArray: [entity3.AccountBean145996470_JDOState@5332ca]
    Please note that the insert statement has the ejb-name (I think so, as my CMP EJB is called ACCOUNTCMP) instead of the actual tablename (account).
    I do have the account.dbschema file and sun-cmp-mappings.xml in the NB 5.5 project, but the mappings.xml file is not included in the jar by NB. Is that expected, or an problem.
    sun-cmp-mappings.xml
    <sun-cmp-mappings>
      <sun-cmp-mapping>
        <schema>account</schema>   
        <entity-mapping>
          <ejb-name>AccountCMP</ejb-name>
          <table-name>account</table-name>
          <cmp-field-mapping>
    ejb-jar.xml
    <enterprise-beans>
            <entity>
                <ejb-name>AccountCMP</ejb-name>
                <local-home>entity3.AccountLocalHome</local-home>
                <local>entity3.AccountLocal</local>
                <ejb-class>entity3.AccountBean</ejb-class>           
                <persistence-type>Container</persistence-type>
                <prim-key-class>entity3.AccountPK</prim-key-class>
                <reentrant>false</reentrant>
                <cmp-version>2.x</cmp-version>           
                <abstract-schema-name>account</abstract-schema-name>  Thank you for your help.

    Hello,
    I found out the issue. sun-cmp-mappings.xml file is mandatory, and dont know why, netbeans excludes this file from the jar. I had to edit project.properties file to negate this exclusion.
    Another problem was that my table did not have a primary key (and hence by schema file did not have it also). CMP bean code generator did not like this.
    Once I fixed these two problems, my CMP started working fine.
    Thank you all

  • "ORA-00903: invalid table name" when enqueue using a CLOB in an ADT payload

    I am attempting to enqueue into an AQ that has an ADT with a CLOB field in it. If I leave the CLOB empty, it works. As soon as I place content in it, I get the error below in the BPEL log.
    I actually get the same problem when I run the "AQ_ADT_with_CLOB_Payload" example. Please help!
    Error in the BPEL log:
    <2005-11-08 09:22:07,784> <ERROR> <default.collaxa.cube.ws> <AQ Adapter::Outbound> MessageWriter_enqueue: Could not enqueue message due to database error
    <2005-11-08 09:22:07,784> <ERROR> <default.collaxa.cube.ws> <AQ Adapter::Outbound>
    java.sql.SQLException: ORA-00903: invalid table name
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:625)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:661)
    at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:951)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:693)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1057)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2901)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2942)
    at oracle.tip.adapter.aq.database.MessageWriter.doEnqueue(MessageWriter.java:530)
    at oracle.tip.adapter.aq.database.MessageWriter.enqueue(MessageWriter.java:341)
    at oracle.tip.adapter.aq.database.MessageWriter.writeMessage(MessageWriter.java:303)
    at oracle.tip.adapter.aq.outbound.AQEnqueuer.execute(AQEnqueuer.java:108)
    at oracle.tip.adapter.aq.AQInteraction.executeRunTime(AQInteraction.java:194)
    at oracle.tip.adapter.aq.AQInteraction.execute(AQInteraction.java:180)
    at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:469)
    at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeInputOnlyOperation(WSIFOperation_JCA.java:652)
    at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:441)
    at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:310)
    at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:184)
    at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:601)
    at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:316)
    at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:185)
    at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3398)
    at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1905)
    at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:100)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:185)
    at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5410)
    at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1300)
    at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:509)
    at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:307)
    at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
    at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:76)
    at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
    at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
    at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
    at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:748)
    at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:921)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)

    OK, I figured it out myself. :)
    Turns out when I define the queue name in the AQ Adapter definition, I was specifying "<Default Schema>" as the schema name. When I changed this to my actual schema name (eg: "SCOTT"), it worked. Nice little bug there!
    The reason it broke with the example program is because I was changing the schema name before I deployed it. As I didn't have a SCOTT schema.
    So the moral of the story here is, don't use "<Default Schema>"!
    I was running on 10.1.2.0.0 [build #1787 ]. In case anyone wants to fix this.

  • Petstore install problem on Derby and Mysql (Linux) - Upper case table name

    Hi
    I seem to have a problem which may also be at the heart of many threads here - the tables are created in lower case yet referenced in UPPER CASE.
    If the DB is case sensitive, the tables arent found.
    does anyone have an UPPER CASED VERSION OF THE SETUP SCRIPT ????
    1) setup/sql/javadb/petstore.sql contains all table and field names in lower case
    in Netbeans look under ServerResources/sql
    i.e.
    create table tag(
    tagid INTEGER NOT NULL,
    tag VARCHAR(30) NOT NULL,
    refcount INTEGER NOT NULL,
    primary key (tagid),
    unique(tag)
    2) the petstore app tries to access using CAPITALISED NAMES
    i.e.
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: org.apache.derby.client.am.SqlException: Schema 'PETSTORE' does not existError Code: -1
    Call:SELECT TAGID, REFCOUNT, TAG FROM TAG ORDER BY REFCOUNT DESC, TAG ASC
    Query:ReportQuery(com.sun.javaee.blueprints.petstore.model.Tag)
    at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
    3) In mysql, the table names are .......
    mysql> describe tag;
    --------------------------------------------------+
    | Field | Type | Null | Key | Default | Extra |
    --------------------------------------------------+
    | tagid | int(11) | NO | PRI | | |
    | tag | varchar(30) | NO | UNI | | |
    | refcount | int(11) | NO | | | |
    --------------------------------------------------+
    3 rows in set (0.02 sec)
    I HATE DBAs THAT ONLY KNOW HOW TO SHOUT :-)
    chris

    Here is a replacement of the offender - have fun
    create table CATEGORY(
    CATEGORYID VARCHAR(10) NOT NULL,
    NAME VARCHAR(25) NOT NULL,
    DESCRIPTION VARCHAR(255) NOT NULL,
    IMAGEURL VARCHAR(55),
    primary key (CATEGORYID)
    CREATE TABLE PRODUCT (
    PRODUCTID VARCHAR(10) NOT NULL,
    CATEGORYID VARCHAR(10) NOT NULL,
    NAME VARCHAR(25) NOT NULL,
    DESCRIPTION VARCHAR(255) NOT NULL,
    IMAGEURL VARCHAR(55),
    primary key (PRODUCTID),
    foreign key (CATEGORYID) references CATEGORY(CATEGORYID)
    CREATE TABLE ADDRESS (
    ADDRESSID VARCHAR(10) NOT NULL,
    STREET1 VARCHAR(55) NOT NULL,
    STREET2 VARCHAR(55),
    CITY VARCHAR(55) NOT NULL,
    STATE VARCHAR(25) NOT NULL,
    ZIP VARCHAR(5) NOT NULL,
    LATITUDE DECIMAL(14,10) NOT NULL,
    LONGITUDE DECIMAL(14,10) NOT NULL,
    primary key (ADDRESSID)
    CREATE TABLE SELLERCONTACTINFO (
    CONTACTINFOID VARCHAR(10) NOT NULL,
    LASTNAME VARCHAR(24) NOT NULL,
    FIRSTNAME VARCHAR(24) NOT NULL,
    EMAIL VARCHAR(24) NOT NULL,
    primary key (CONTACTINFOID)
    CREATE TABLE ITEM (
    ITEMID VARCHAR(10) NOT NULL,
    PRODUCTID VARCHAR(10) NOT NULL,
    NAME VARCHAR(30) NOT NULL,
    DESCRIPTION VARCHAR(500) NOT NULL,
    IMAGEURL VARCHAR(55),
    IMAGETHUMBURL VARCHAR(55),
    PRICE DECIMAL(14,2) NOT NULL,
    ADDRESS_ADDRESSID VARCHAR(10) NOT NULL,
    CONTACTINFO_CONTACTINFOID VARCHAR(10) NOT NULL,
    TOTALSCORE INTEGER NOT NULL,
    NUMBEROFVOTES INTEGER NOT NULL,
    DISABLED INTEGER NOT NULL,
    primary key (ITEMID),
    foreign key (ADDRESS_ADDRESSID) references ADDRESS(ADDRESSID),
    foreign key (PRODUCTID) references PRODUCT(PRODUCTID),
    foreign key (CONTACTINFO_CONTACTINFOID) references SELLERCONTACTINFO(CONTACTINFOID)
    CREATE TABLE ID_GEN (
    GEN_KEY VARCHAR(20) NOT NULL,
    GEN_VALUE INTEGER NOT NULL,
    primary key (GEN_KEY)
    CREATE TABLE ZIPLOCATION (
    ZIPCODE INTEGER NOT NULL,
    CITY VARCHAR(30) NOT NULL,
    STATE VARCHAR(2) NOT NULL,
    primary key (ZIPCODE)
    create table TAG(
    TAGID INTEGER NOT NULL,
    TAG VARCHAR(30) NOT NULL,
    REFCOUNT INTEGER NOT NULL,
    primary key (TAGID),
    unique(TAG)
    create table TAG_ITEM(
    TAGID INTEGER NOT NULL,
    ITEMID VARCHAR(10) NOT NULL,
    unique(TAGid, ITEMID),
    foreign key (ITEMID) references ITEM(ITEMID),
    foreign key (TAGID) references TAG(TAGID)
    INSERT INTO CATEGORY VALUES('CATS', 'Cats', 'Loving and finicky friends', 'cats_icon.gif');
    INSERT INTO CATEGORY VALUES('DOGS', 'Dogs', 'Loving and furry friends', 'dogs_icon.gif');
    INSERT INTO CATEGORY VALUES('BIRDS', 'Birds', 'Loving and feathery friends', 'birds_icon.gif');
    INSERT INTO CATEGORY VALUES('REPTILES', 'Reptiles', 'Loving and scaly friends', 'reptiles_icon.gif');
    INSERT INTO CATEGORY VALUES('FISH', 'Fish', 'Loving aquatic friends', 'fish_icon.gif');
    INSERT INTO PRODUCT VALUES('feline01', 'CATS', 'Hairy Cat', 'Great for reducing mouse populations', 'cat1.gif');
    INSERT INTO PRODUCT VALUES('feline02', 'CATS', 'Groomed Cat', 'Friendly house cat keeps you away from the vacuum', 'cat2.gif');
    INSERT INTO PRODUCT VALUES('canine01', 'DOGS', 'Medium Dogs', 'Friendly dog from England', 'dog1.gif');
    INSERT INTO PRODUCT VALUES('canine02', 'DOGS', 'Small Dogs', 'Great companion dog to sit on your lap','dog2.gif');
    INSERT INTO PRODUCT VALUES('avian01', 'BIRDS', 'Parrot', 'Friend for a lifetime.', 'bird1.gif');
    INSERT INTO PRODUCT VALUES('avian02', 'BIRDS', 'Exotic', 'Impress your friends with your colorful friend.','bird2.gif');
    INSERT INTO PRODUCT VALUES('fish01', 'FISH', 'Small Fish', 'Fits nicely in a small aquarium.','fish2.gif');
    INSERT INTO PRODUCT VALUES('fish02', 'FISH', 'Large Fish', 'Need a large aquarium.','fish3.gif');
    INSERT INTO PRODUCT VALUES('reptile01', 'REPTILES', 'Slithering Reptiles', 'Slides across the floor.','lizard1.gif');
    INSERT INTO PRODUCT VALUES('reptile02', 'REPTILES', 'Crawling Reptiles', 'Uses legs to move fast.','lizard2.gif');
    INSERT INTO ADDRESS VALUES('1', 'W el Camino Real & Castro St', '', 'Mountain View','CA','94040',37.38574,-122.083973);
    INSERT INTO ADDRESS VALUES('2', 'Shell Blvd & Beach Park Blvd', '', 'Foster CITY','CA','94404',37.546935,-122.263978);
    INSERT INTO ADDRESS VALUES('3', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('4', 'S 1st St & W Santa Clara St', '', 'San Jose','CA','95113',37.336141,-121.890666);
    INSERT INTO ADDRESS VALUES('5', '1st St & Market St ', '', 'San Francisco','CA','94105',37.791028,-122.399082);
    INSERT INTO ADDRESS VALUES('6', 'Paseo Padre Pky & Fremont Blvd', '', 'Fremont','CA','94555',37.575035,-122.041273);
    INSERT INTO ADDRESS VALUES('7', 'W el Camino Real & S Mary Ave', '', 'Sunnyvale','CA','94087',37.371641,-122.048772);
    INSERT INTO ADDRESS VALUES('8', 'Bay STREET and Columbus Ave ', '', 'San Francisco','CA','94133',37.805328,-122.416882);
    INSERT INTO ADDRESS VALUES('9', 'El Camino Real & Scott Blvd', '', 'Santa Clara','CA','95050',37.352141 ,-121.959569);
    INSERT INTO ADDRESS VALUES('10', 'W el Camino Real & Hollenbeck Ave', '', 'Sunnyvale','CA','94087',37.369941,-122.041271);
    INSERT INTO ADDRESS VALUES('11', 'S Main St & Serra Way', '', 'Milpitas','CA','95035',37.428112,-121.906505);
    INSERT INTO ADDRESS VALUES('12', 'Great Mall Pky & S Main St', '', 'Milpitas','CA','95035',37.414722,-121.902085);
    INSERT INTO ADDRESS VALUES('13', 'Valencia St & 16th St', '', 'San Francisco','CA','94103',37.764985,-122.421886);
    INSERT INTO ADDRESS VALUES('14', 'S 1st St & W Santa Clara St', '', 'San Jose','CA','95113',37.336141,-121.890666);
    INSERT INTO ADDRESS VALUES('15', 'Bay STREET and Columbus Ave ', '', 'San Francisco','CA','94133',37.805328,-122.416882);
    INSERT INTO ADDRESS VALUES('16', 'El Camino Real & Scott Blvd', '', 'Santa Clara','CA','95050',37.352141 ,-121.959569);
    INSERT INTO ADDRESS VALUES('17', 'Millbrae Ave & Willow Ave', '', 'Millbrae ','CA','94030',37.596635,-122.391083);
    INSERT INTO ADDRESS VALUES('18', 'Leavesley Rd & Monterey Rd', '', 'Gilroy','CA','95020',37.019447,-121.574953);
    INSERT INTO ADDRESS VALUES('19', 'S Main St & Serra Way', '', 'Milpitas','CA','95035',37.428112,-121.906505);
    INSERT INTO ADDRESS VALUES('20', '24th St & Dolores St', '', 'San Francisco','CA','94114',37.75183,-122.424982);
    INSERT INTO ADDRESS VALUES('21', 'Great Mall Pky & S Main St', '', 'Milpitas','CA','95035',37.414722,-121.902085);
    INSERT INTO ADDRESS VALUES('22', 'Grant Rd & South Dr ', '', 'Mountain view','CA','94040',37.366941,-122.078073);
    INSERT INTO ADDRESS VALUES('23', '25th St & Dolores St', '', 'San Francisco','CA','94114',37.75013,-122.424782);
    INSERT INTO ADDRESS VALUES('24', 'Ellis St & National Ave', '', 'Mountain view','CA','94043',37.40094,-122.052272);
    INSERT INTO ADDRESS VALUES('25', '1st St & Market St ', '', 'San Francisco','CA','94105',37.791028,-122.399082);
    INSERT INTO ADDRESS VALUES('26', 'San Antonio Rd & Middlefield Rd', '', 'Palo Alto','CA','94303',37.416239,-122.103474);
    INSERT INTO ADDRESS VALUES('27', '20th St & Dolores St', '', 'San Francisco','CA','94114',37.75823,-122.425582);
    INSERT INTO ADDRESS VALUES('28', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('29', 'Dolores St & San Jose Ave', '', 'San Francisco','CA','94110',37.74023,-122.423782);
    INSERT INTO ADDRESS VALUES('30', 'Leavesley Rd & Monterey Rd', '', 'Gilroy','CA','95020',37.019447,-121.574953);
    INSERT INTO ADDRESS VALUES('31', 'Palm Dr & Arboretum Rd', '', 'Stanford','CA','94305',37.437838,-122.166975);
    INSERT INTO ADDRESS VALUES('32', 'Millbrae Ave & Willow Ave', '', 'Millbrae ','CA','94030',37.596635,-122.391083);
    INSERT INTO ADDRESS VALUES('33', 'Cesar Chavez St & Sanchez', '', 'San Francisco','CA','94131',37.74753,-122.428982);
    INSERT INTO ADDRESS VALUES('34', 'University Ave & Middlefield Rd', '', 'Palo Alto','CA','94301',37.450638,-122.156975);
    INSERT INTO ADDRESS VALUES('35', 'Bay STREET and Columbus Ave ', '', 'San Francisco','CA','94133',37.805328,-122.416882);
    INSERT INTO ADDRESS VALUES('36', 'Telegraph Ave & Bancroft Way', '', 'Berkeley','CA','94704',37.868825,-122.25978);
    INSERT INTO ADDRESS VALUES('37', '1st St & Market St ', '', 'San Francisco','CA','94105',37.791028,-122.399082);
    INSERT INTO ADDRESS VALUES('38', 'San Antonio Rd & Middlefield Rd', '', 'Palo Alto','CA','94303',37.416239,-122.103474);
    INSERT INTO ADDRESS VALUES('39', '20th St & Dolores St', '', 'San Francisco','CA','94114',37.75823,-122.425582);
    INSERT INTO ADDRESS VALUES('40', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('41', 'Dolores St & San Jose Ave', '', 'San Francisco','CA','94110',37.74023,-122.423782);
    INSERT INTO ADDRESS VALUES('42', '4th St & Howard St', '', 'San Francisco','CA','94103',37.783229,-122.402582);
    INSERT INTO ADDRESS VALUES('43', 'Palm Dr & Arboretum Rd', '', 'Stanford','CA','94305',37.437838,-122.166975);
    INSERT INTO ADDRESS VALUES('44', 'Campbell St & Riverside Ave', '', 'Santa Cruz','CA','95060',36.96985,-122.019473);
    INSERT INTO ADDRESS VALUES('45', 'Cesar Chavez St & Sanchez', '', 'San Francisco','CA','94131',37.74753,-122.428982);
    INSERT INTO ADDRESS VALUES('46', 'University Ave & Middlefield Rd', '', 'Palo Alto','CA','94301',37.450638,-122.156975);
    INSERT INTO ADDRESS VALUES('47', 'W el Camino Real & S Mary Ave', '', 'Sunnyvale','CA','94087',37.371641,-122.048772);
    INSERT INTO ADDRESS VALUES('48', 'Telegraph Ave & Bancroft Way', '', 'Berkeley','CA','94704',37.868825,-122.25978);
    INSERT INTO ADDRESS VALUES('49', '1st St & Market St ', '', 'San Francisco','CA','94105',37.791028,-122.399082);
    INSERT INTO ADDRESS VALUES('50', 'San Antonio Rd & Middlefield Rd', '', 'Palo Alto','CA','94303',37.416239,-122.103474);
    INSERT INTO ADDRESS VALUES('51', '20th St & Dolores St', '', 'San Francisco','CA','94114',37.75823,-122.425582);
    INSERT INTO ADDRESS VALUES('52', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('53', 'Dolores St & San Jose Ave', '', 'San Francisco','CA','94110',37.74023,-122.423782);
    INSERT INTO ADDRESS VALUES('54', '4th St & Howard St', '', 'San Francisco','CA','94103',37.783229,-122.402582);
    INSERT INTO ADDRESS VALUES('55', 'Palm Dr & Arboretum Rd', '', 'Stanford','CA','94305',37.437838,-122.166975);
    INSERT INTO ADDRESS VALUES('56', 'W el Camino Real & S Mary Ave', '', 'Sunnyvale','CA','94087',37.371641,-122.048772);
    INSERT INTO ADDRESS VALUES('57', 'Campbell St & Riverside Ave', '', 'Santa Cruz','CA','95060',36.96985,-122.019473);
    INSERT INTO ADDRESS VALUES('58', 'University Ave & Middlefield Rd', '', 'Palo Alto','CA','94301',37.450638,-122.156975);
    INSERT INTO ADDRESS VALUES('59', 'Bay STREET and Columbus Ave ', '', 'San Francisco','CA','94133',37.805328,-122.416882);
    INSERT INTO ADDRESS VALUES('60', 'Telegraph Ave & Bancroft Way', '', 'Berkeley','CA','94704',37.868825,-122.25978);
    INSERT INTO ADDRESS VALUES('61', 'San Antonio Rd & Middlefield Rd', '', 'Palo Alto','CA','94303',37.416239,-122.103474);
    INSERT INTO ADDRESS VALUES('62', '20th St & Dolores St', '', 'San Francisco','CA','94114',37.75823,-122.425582);
    INSERT INTO ADDRESS VALUES('63', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('64', 'Dolores St & San Jose Ave', '', 'San Francisco','CA','94110',37.74023,-122.423782);
    INSERT INTO ADDRESS VALUES('65', 'W el Camino Real & S Mary Ave', '', 'Sunnyvale','CA','94087',37.371641,-122.048772);
    INSERT INTO ADDRESS VALUES('66', 'Palm Dr & Arboretum Rd', '', 'Stanford','CA','94305',37.437838,-122.166975);
    INSERT INTO ADDRESS VALUES('67', 'Millbrae Ave & Willow Ave', '', 'Millbrae ','CA','94030',37.596635,-122.391083);
    INSERT INTO ADDRESS VALUES('68', 'Cesar Chavez St & Sanchez', '', 'San Francisco','CA','94131',37.74753,-122.428982);
    INSERT INTO ADDRESS VALUES('69', 'University Ave & Middlefield Rd', '', 'Palo Alto','CA','94301',37.450638,-122.156975);
    INSERT INTO ADDRESS VALUES('70', 'Bay STREET and Columbus Ave ', '', 'San Francisco','CA','94133',37.805328,-122.416882);
    INSERT INTO ADDRESS VALUES('71', 'Leavesley Rd & Monterey Rd', '', 'Gilroy','CA','95020',37.019447,-121.574953);
    INSERT INTO ADDRESS VALUES('72', 'Campbell St & Riverside Ave', '', 'Santa Cruz','CA','95060',36.96985,-122.019473);
    INSERT INTO ADDRESS VALUES('73', '20th St & Dolores St', '', 'San Francisco','CA','94114',37.75823,-122.425582);
    INSERT INTO ADDRESS VALUES('74', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('75', 'Dolores St & San Jose Ave', '', 'San Francisco','CA','94110',37.74023,-122.423782);
    INSERT INTO ADDRESS VALUES('76', '4th St & Howard St', '', 'San Francisco','CA','94103',37.783229,-122.402582);
    INSERT INTO ADDRESS VALUES('77', 'Palm Dr & Arboretum Rd', '', 'Stanford','CA','94305',37.437838,-122.166975);
    INSERT INTO ADDRESS VALUES('78', 'Millbrae Ave & Willow Ave', '', 'Millbrae ','CA','94030',37.596635,-122.391083);
    INSERT INTO ADDRESS VALUES('79', 'Campbell St & Riverside Ave', '', 'Santa Cruz','CA','95060',36.96985,-122.019473);
    INSERT INTO ADDRESS VALUES('80', 'University Ave & Middlefield Rd', '', 'Palo Alto','CA','94301',37.450638,-122.156975);
    INSERT INTO ADDRESS VALUES('81', 'Grant Rd & South Dr ', '', 'Mountain view','CA','94040',37.366941,-122.078073);
    INSERT INTO ADDRESS VALUES('82', 'Telegraph Ave & Bancroft Way', '', 'Berkeley','CA','94704',37.868825,-122.25978);
    INSERT INTO ADDRESS VALUES('83', 'San Antonio Rd & Middlefield Rd', '', 'Palo Alto','CA','94303',37.416239,-122.103474);
    INSERT INTO ADDRESS VALUES('84', '20th St & Dolores St', '', 'San Francisco','CA','94114',37.75823,-122.425582);
    INSERT INTO ADDRESS VALUES('85', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('86', 'Dolores St & San Jose Ave', '', 'San Francisco','CA','94110',37.74023,-122.423782);
    INSERT INTO ADDRESS VALUES('87', '4th St & Howard St', '', 'San Francisco','CA','94103',37.783229,-122.402582);
    INSERT INTO ADDRESS VALUES('88', 'Palm Dr & Arboretum Rd', '', 'Stanford','CA','94305',37.437838,-122.166975);
    INSERT INTO ADDRESS VALUES('89', 'Millbrae Ave & Willow Ave', '', 'Millbrae ','CA','94030',37.596635,-122.391083);
    INSERT INTO ADDRESS VALUES('90', 'Paseo Padre Pky & Fremont Blvd', '', 'Fremont','CA','94555',37.575035,-122.041273);
    INSERT INTO ADDRESS VALUES('91', 'University Ave & Middlefield Rd', '', 'Palo Alto','CA','94301',37.450638,-122.156975);
    INSERT INTO ADDRESS VALUES('92', 'El Camino Real & Scott Blvd', '', 'Santa Clara','CA','95050',37.352141 ,-121.959569);
    INSERT INTO ADDRESS VALUES('93', 'Telegraph Ave & Bancroft Way', '', 'Berkeley','CA','94704',37.868825,-122.25978);
    INSERT INTO ADDRESS VALUES('94', 'San Antonio Rd & Middlefield Rd', '', 'Palo Alto','CA','94303',37.416239,-122.103474);
    INSERT INTO ADDRESS VALUES('95', '20th St & Dolores St', '', 'San Francisco','CA','94114',37.75823,-122.425582);
    INSERT INTO ADDRESS VALUES('96', 'River Oaks Pky & Village Center Dr', '', 'San Jose','CA','95134',37.398259,-121.922367);
    INSERT INTO ADDRESS VALUES('97', 'Dolores St & San Jose Ave', '', 'San Francisco','CA','94110',37.74023,-122.423782);
    INSERT INTO ADDRESS VALUES('98', 'Campbell St & Riverside Ave', '', 'Santa Cruz','CA','95060',36.96985,-122.019473);
    INSERT INTO ADDRESS VALUES('99', 'Palm Dr & Arboretum Rd', '', 'Stanford','CA','94305',37.437838,-122.166975);
    INSERT INTO ADDRESS VALUES('100', 'Leavesley Rd & Monterey Rd', '', 'Gilroy','CA','95020',37.019447,-121.574953);
    INSERT INTO ADDRESS VALUES('101', 'Cesar Chavez St & Sanchez', '', 'San Francisco','CA','94131',37.74753,-122.428982);
    INSERT INTO ADDRESS VALUES('102', 'University Ave & Middlefield Rd', '', 'Palo Alto','CA','94301',37.450638,-122.156975);
    INSERT INTO SELLERCONTACTINFO VALUES('1', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('2', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('3', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('4', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('5', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('6', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('7', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('8', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('9', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('10', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('11', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('12', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('13', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('14', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('15', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('16', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('17', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('18', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('19', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('20', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('21', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('22', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('23', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('24', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('25', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('26', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('27', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('28', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('29', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('30', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('31', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('32', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('33', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('34', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('35', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('36', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('37', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('38', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('39', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('40', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('41', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('42', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('43', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('44', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('45', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('46', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('47', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('48', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('49', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('50', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('51', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('52', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('53', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('54', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('55', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('56', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('57', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('58', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('59', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('60', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('61', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('62', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('63', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('64', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('65', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('66', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('67', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('68', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('69', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('70', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('71', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('72', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('73', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('74', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('75', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('76', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('77', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('78', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('79', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('80', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('81', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('82', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('83', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('84', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('85', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('86', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('87', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('88', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('89', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('90', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('91', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('92', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('93', 'Basler', 'Mark', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('94', 'Yoshida', 'Yutaka', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('95', 'Kangath', 'Smitha', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('96', 'Freeman', 'Larry', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('97', 'Kaul', 'Jeet', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('98', 'Burns', 'Ed', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('99', 'McClanahan', 'Craig', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('100', 'Murray', 'Greg', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('101', 'Brydon', 'Sean', '[email protected]');
    INSERT INTO SELLERCONTACTINFO VALUES('102', 'Singh', 'Inderjeet', '[email protected]');
    INSERT INTO ITEM VALUES('1', 'feline01', 'Friendly Cat', 'This black and white colored cat is super friendly. Anyone passing by your front yard will find him puring at their feet and trying to make a new friend. His NAME is Anthony, but I call him Ant as a nickNAME since he loves to eat ants and other insects.', 'images/anthony.jpg','images/anthony-s.jpg', 307.10,'1','1', 15, 3, 0);
    INSERT INTO ITEM VALUES('2', 'feline01', 'Fluffy Cat', 'A great pet for a hair stylist! Have fun combing Bailey''s silver mane. Maybe trim his whiskers? He is very patient and loves to be pampered.', 'images/bailey.jpg','images/bailey-s.jpg', 307,'2','2', 15, 5, 0);
    INSERT INTO ITEM VALUES('3', 'feline02', 'Sneaky Cat', 'My cat is so sneaky. He is so curious that he just has to poke his nose into everything going on in the house. Everytime I turn around, BAM, he is in the room peaking at what I am doing. Nothing escapes his keen eye. He should be a spy in the CIA!', 'images/bob.jpg','images/bob-s.jpg', 307.20,'3','3', 15, 7, 0);
    INSERT INTO ITEM VALUES('4', 'feline02', 'Lazy Cat', 'A great pet to lounge on the sofa with. If you want a friend to watch TV with, this is the cat for you. Plus, she wont even ask for the remote! Really, could you ask for a better friend to lounge with?', 'images/chantelle.jpg','images/chantelle-s.jpg', 307.30,'4','4', 15, 5, 0);
    INSERT INTO ITEM VALUES('5', 'feline01', 'Old Cat', 'A great old pet retired from duty in the circus. This fully-trained tiger is looking for a place to retire. Loves to roam free and loves to eat other animals.', 'images/charlie.jpg','images/charlie-s.jpg', 307,'5','5', 15, 5, 0);
    INSERT INTO ITEM VALUES('6', 'feline02', 'Young Female cat', 'A great young pet to chase around. Loves to play with a ball of string. Bring some instant energy into your home.', 'images/elkie.jpg','images/elkie-s.jpg', 307.40,'6','6', 15, 5, 0);
    INSERT INTO ITEM VALUES('7', 'feline01', 'Playful Female Cat', 'A needy pet. This cat refuses to grow up. Do you like playful spirits? I need lots of attention. Please do not leave me alone, not even for a minute.', 'images/faith.jpg','images/faith-s.jpg', 307,'7','7', 15, 5, 0);
    INSERT INTO ITEM VALUES('8', 'feline01', 'White Fluffy Cat', 'This fluffy white cat looks like a snowball. Plus, she likes playing outside in the snow and it looks really cool to see this snowball cat run around on the ski slopes. I hope you have white carpet as this cat sheds lots of hair.', 'images/gaetano.jpg','images/gaetano-s.jpg', 307.50,'8','8', 15, 15, 0);
    INSERT INTO ITEM VALUES('9', 'feline02', 'Tiger Stripe Cat', 'This little tiger thinks it has big teeth. A great wild pet for an adventurous person. May eat your other pets so be careful- just kidding. This little tiger is affectionate.', 'images/harmony.jpg','images/harmony-s.jpg', 307,'9','9', 15, 3, 0);
    INSERT INTO ITEM VALUES('10', 'feline02', 'Alley Cat', 'Meow Meow in the back alley cat fights! This cat keeps the racoons away, but still has class.', 'images/katzen.jpg','images/katzen-s.jpg', 307.60,'10','10', 15, 5, 0);
    INSERT INTO ITEM VALUES('11', 'feline02', 'Speedy Cat', 'Fastest and coolest cat in town. If you always wanted to own a cheetah, this cat is even faster and better looking. No dog could ever catch this bolt of lightening.', 'images/mario.jpg','images/mario-s.jpg', 307,'11','11', 15, 10, 0);
    INSERT INTO ITEM VALUES('12', 'feline01', 'Stylish Cat', 'A high maintenance cat for an owner with time. This cat needs pampering: comb it hair, brush its teeth, wash its fur, paint its claws. For all you debutantes, let the world know you have arrived in style with this snooty cat in your purse!', 'images/mimi.jpg','images/mimi-s.jpg', 307.70,'12','12', 15, 4, 0);
    INSERT INTO ITEM VALUES('13', 'feline01', 'Smelly Cat', 'A great pet with its own song to sing with your fiends. "Smelly cat, Smelly cat ..." Need an excuse for that funky odor in your house? Smelly cat is the answer.', 'images/monique.jpg','images/monique-s.jpg', 307.80,'13','13', 15, 8, 0);
    INSERT INTO ITEM VALUES('14', 'feline01', 'Saber Cat', 'A great watch pet. Want to keep your roommates from stealing the beer from your refrigerator? This big-toothed crazy cat is better than a watchdog. Just place him on top of the refrigerator and watch him pounce when so-called friends try to sneak a beer. This cat is great fun at parties.', 'images/olie.jpg','images/olie-s.jpg', 307.90,'14','14', 15, 3, 0);
    INSERT INTO ITEM VALUES('15', 'feline01', 'Sophisticated Cat', 'This cat is from Paris. It has a very distinguished history and is looking for a castle to play in. This sophisticated cat has class and taste. No chasing on string, no catnip habits. Only the habits of royalty in this cats blood.', 'images/paris.jpg','images/paris-s.jpg', 307,'15','15', 15, 4, 0);
    INSERT INTO ITEM VALUES('16', 'feline01', 'Princess cat', 'Just beauty and elegance. She will charm you from the moment she enters the room.', 'images/princess.jpg','images/princess-s.jpg', 307,'16','16', 15, 5, 0);
    INSERT INTO ITEM VALUES('17', 'feline02', 'Lazy cat', 'Wow! This cat is cool. It has a beautiful tan coat. I wish I could get a sun tan of that color.', 'images/simba.jpg','images/simba-s.jpg', 307,'17','17', 15, 3, 0);
    INSERT INTO ITEM VALUES('18', 'feline02', 'Scapper male cat', 'A scappy cat that likes to cause trouble. If you are looking for a challenge to your cat training skills, this scapper is the test!', 'images/thaicat.jpg','images/thaicat-s.jpg', 307,'18','18', 15, 5, 0);
    INSERT INTO ITEM VALUES('19', 'feline01', 'Lazy cat', 'Buy me please. I love to sleep.', 'images/cat1.gif','images/cat1.gif', 307,'19','19', 15, 6, 0);
    INSERT INTO ITEM VALUES('20', 'feline01', 'Old Cat', 'A great old pet retired from duty in the circus. This fully-trained tiger is looking for a place to retire. Loves to roam free and loves to eat other animals.', 'images/cat2.gif','images/cat2.gif', 200,'20','20', 15, 3, 0);
    INSERT INTO ITEM VALUES('21', 'feline01', 'Young Cat', 'A great young pet to chase around. Loves to play with a ball of string.', 'images/cat3.gif','images/cat3.gif', 350,'21','21', 15, 3, 0);
    INSERT INTO ITEM VALUES('22', 'feline01', 'Scrappy Cat', 'A real trouble-maker in the neighborhood. Looking for some T.L.

  • PreparedStatement and table name

    Hi,
    I have the following snippet, and it seems that I cannot use the function
    prepStmt.setString(1, TABLE_NAME);
    to set the table name for the SQL prepared statement. What function should I use?
    Thanks,
    Rocky
    final String[] TABLE_NAME =
    "Borrower",
    "Loan",
    "Depositor",
    "Account",
    "Customer",
    "Branch",
    final String DATA_DELETE = "DELETE * FROM ?";
    try
    PreparedStatement prepStmt = dbConn.prepareStatement(DATA_DELETE);
    for (int i =0; i < TABLE_NAME.length; i++)
    System.out.println(TABLE_NAME[i]);
    prepStmt.setString(1, TABLE_NAME[i]);
    prepStmt.execute();
    prepStmt.clearParameters();
    dbConn.commit();     //     not needed
    prepStmt.close();
    catch(SQLException e)
    System.out.println(e.getMessage());

    setString is just a specific case of setting a field value should not be used to set table name
    what u want to do should be done at the sql String level and it's not necessary prepared statements
    This would be my suggestion (didn't test it):
    final String[] TABLE_NAME =
    "Borrower",
    "Loan",
    "Depositor",
    "Account",
    "Customer",
    "Branch",
    final String DATA_DELETE = "DELETE * FROM TABLE_NAME";
    try
    Statement stmt = dbConn.createStatement();
    for (int i =0; i < TABLE_NAME.length; i++)
    System.out.println(TABLE_NAME);
    stmt.executeUpdate(
    sql.replaceFirst("TABLE_NAME",TABLE_NAME[i])
    dbConn.commit();     //     not needed
    stmt.close();
    catch(SQLException e)
    System.out.println(e.getMessage());

  • Invalid table name when pass in the table name as variable in dynamic sql

    Hi,
    I need to create a stored procedure which will return a list of data to my java application like the following.
    first, select the table name from the first table.
    For example : SELECT T_NAME FROM MDR_SMSTABLES
    second, select the data from the table which returned by first select statement
    For example : SELECT * FROM T_NAME.
    I use dynamic sql with cursor to select the data. But it returns "java.sql.SQLException: ORA-00903: invalid table name"
    I fetch the table name to varchar2. I think this might the cause it returns me the this error. But i don't know what type should i put for the table name other then varchar2.
    val2 VARCHAR2(200);
    OPEN cv FOR
    SELECT T_NAME FROM MDR_SMSTABLES WHERE T_DATE=d_dt_sent;
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR
    'SELECT * FROM :t WHERE MID = :m' USING val2, msg_id;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    As my stored procedure is quite long, so i just paste some of the code here. Hope the information is enough. Can anyone please help?
    Thanks

    DECLARE
    val2 VARCHAR2 (200);
    cv sys_refcursor;
    refcur sys_refcursor;
    BEGIN
    OPEN cv FOR
    SELECT table_name
    FROM user_tables
    WHERE table_name IN ('EMP', 'DEPT');
    FETCH cv INTO val2;
    WHILE cv%FOUND
    LOOP
    OPEN refcur FOR 'SELECT * FROM '||val2;
    EXIT WHEN refcur IS NOT NULL;
    FETCH cv INTO val2;
    END LOOP;
    END;

  • Table names

    hi,
    i have a foxpro .dbf file. I want to view this file's content. I try to import data to access, but it fails. I search alot. Finally I make a connection to this file using
    jdbc.
    My file name is 3006.dbf , i added it to "user dns" (mic->control panel->admin. tools ->data source) and write a small class. No exception occured , i think connection is ok.
    import java.sql.*;
    public class jdbc3 {
         public static void main(String[] args) {
              String data = "jdbc:odbc:3006";
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection conn = DriverManager.getConnection(data);
              } catch (Exception e) {
                   e.printStackTrace();
                   System.out.println("Error -" + e.toString());
    }But i dont know, table names, column names etc. How can i view content of this file.
    &#304; also found a code at this forum, which shows , how to get table names
    i tried
    import java.sql.*;
    public class jdbc3 {
         public static void main(String[] args) {
              String data = "jdbc:odbc:3006";
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection conn = DriverManager.getConnection(data);
                            DatabaseMetaData metadata = conn.getMetaData();
                   String[] names = { "TABLE" };
                   ResultSet tables = metadata.getTables(null, "%", "%", names);
                   while (tables.next()) {
                        String tableName = tables.getString("TABLE_NAME");
                        String tableSchema = tables.getString("TABLE_SCHEM");
                        String tableType = tables.getString("TABLE_TYPE");
                        System.out.println("Table Name:" + tableName
                                  + " Table Schema: " + tableSchema + " Table Type: "
                                  + tableType);
              } catch (Exception e) {
                   e.printStackTrace();
                   System.out.println("Error -" + e.toString());
    }but i got this exception,
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Driver not capable
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.SQLTables(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(Unknown Source)
         at jdbc3.main(jdbc3.java:16)

    Well, I had that problem, but it's when we don't select a Database. That is to say I didn�t put the path of the database file. Or maybe you're not using the correct odbc.

  • Java.sql.SQLException:  Invalid column name: user_id

    Hi,
    I am using SQL Server 2000 database and using a Java DAO class executing an SQL query using preparedStatement.The issue is that intermittently i get the following exception: "SQLException:Invalid column name". I checked the filed name in the table and the filed name i gave in the resultset.getInt("field_name")and both are matching.The parameter values for the query are fetched from a JSP report and the surprsing issue is that this exception comes on & off. So iam unable to find the cause of this exception.Can anyone help me out?
    Query Used :
    SELECT usrs.user_id,uperm.value,uedis.attrib_value.......
    FROM USERS usrs
    LEFT OUTER JOIN extended_user_attributes uedis
    ON (usrs.user_id = uedis.user_id AND usdis.attrib_id=?),
    user_permission uperm
    WHERE usrs.user_id = uperm.user_id
    AND uperm.name=?
    I am getting exception when iterating resultset.
    ResultSet rs = preparedStatement.executeQuery();
    while(rs.next())
    UserID userid = new UserID();
    userid.setUserID(rs.getInt("user_id"));
    Thanks
    Balaji.M

    Giving an alias name to the column name will work. If the query uses join or fetching rows from multiple tables, then giving an alias name to the column name, should work fine.
    By,
    Sethu
    It seems you have two user_id columns and the server
    or driver names the column automatically(I am not
    sure of that) in some way. Try giving some alias to
    the field you want, like:
    SELECT usrs.user_id
    u_user_id,uperm.value,uedis.attrib_value.......
    userid.setUserID(rs.getInt("u_user_id"));HTH
    MikeBy

  • Preparedstatement - parameterizing table name

    public Vector getTableColumns(String tblName) {         loadDriver();         t.removeAllColumns();         try {             pstmt = conn.prepareStatement("select * from ? where rownum < 1");             pstmt.setString(1, tblName);             rs = pstmt.executeQuery();             rsMetaData = rs.getMetaData();             numberOfColumns = rsMetaData.getColumnCount(); //get the number of columns             for (int i = 0; i < numberOfColumns; i++) {                 // get the designated column's table name.                 t.setColumn(rsMetaData.getColumnName(i + 1)); //get the columns and add them to Vector             }             conn.close();         } catch (SQLException e) {             e.printStackTrace();         } finally {             closeConnection(conn);         }         return t.getColumn(); //return the array of the column names     }
    it says invalid table name
    i tried hardcoding the table name inside and it works though

    OnlyForJava wrote:
    plz suggest another wayAs coded in your first post, presuming that you are not in fact trying to do something from the other thread...
    There is no other way.
    Parameterized types can not be used to represent DDL entities - they can only represent data.

  • SQLException: invalid column name

    I created a view on a Oracle 8.0.5 database which joins three tables. One column of the view is built by subtracting the values of two table-columns by each other. On SQLPlus everything works fine, but when I run a SELECT-Statement over JDBC I got a SQLException: invalid column name. With WHERE-Clauses, which will not have any results the query also works under JDBC.
    An example:
    "select * from OpenOrderPos where OrderID = <myval>" will work when run under SQLPlus
    but not under JDBC and when there should be results
    Here is my code:
    create View OpenOrderPos
    (OrderID, PosNo, ArticleID, ArticleBez, ArtPrice, RestQuantity, Sum)
    as
    select O.OrderID_FK, Count(A.PosNo), Art.ArticleID, Art.ArtDescr,
    Art.ArtPrice, O.Quantity - I.Quantity, (O.Quantity - I.Quantity) * Art.ArtPrice
    from OrderPos O, InvoicePos I, Article Art
    where O.OrderPosID = I.InvPosID and
    O.ArticleID_FK = Art.ArticleID and
    (O.Quantity - I.Quantity) > 0
    Group by O.OrderID_FK, Art.ArticleID, Art.ArtDescr, Art.ArtPrice, O.Quantity - I.Quantity, (O.Qunatity - I.Quantity) * Art.ArtPrice;
    Any ideas would be great!
    Chris

    I would also suggest you specify the column names in your SQL statement. If for no other reason than it is good programming practice. If you explicitly specify your columns instead of use * then you will not have to worry about an invalidated object should the view be changed at a later date. Considering the fact that JDBC makes all database statements dynamic, this is not an issue but once again, it is good programming practice.

  • An sql question about table names

    Is it possible to create a table with a certain name via programmatic manipulation using sql?
    Here is my code, can you please tell me why it's not working, and if there is a way to make it work? I basicaly need to create tables with names corresponding to names in a vector.
    public void files(){
        try {
                FileInputStream file = new FileInputStream("C:\\Documents and Settings\\Adham\\jbproject\\SeniorProject\\id.ser");
                ObjectInputStream input = new ObjectInputStream(file);
                val = (Vector)input.readObject();
                input.close();
          catch (java.io.IOException IOE) {
                 IOE.printStackTrace();
          catch (ClassNotFoundException cnfe) {
                 cnfe.printStackTrace();
      public void createtables()
      {     files();
            String dsn = "jdbc:odbc:etv";
            String dbUser = "Adham";
            String dbPass = "reqss";
            for (int i = 0; i<val.size(); i++){
            String s = val.elementAt(i).toString();
            try {
                Connection con = DriverManager.getConnection(dsn, dbUser, dbPass);
                Statement stmt = con.createStatement();
                String sql = new String("CREATE TABLE "+s + "(Start INTEGER,"+ "End INTEGER,"+ "Channel VARCHAR(255),"+ "Title VARCHAR(255))");
                stmt.executeUpdate(sql);
                stmt.close();
                con.close();
            } catch (Exception e) {
                e.printStackTrace();
                return;
      }your help is greatly appreciated

    It's not that you can't create a table at runtime. You can execute an UPDATE with CREATE TABLE in it.
    I'm saying that the string you're passing in as the table name probably contains a lot more than just the name that you think it does. Print out that string before you execute the SQL and see what it has.
    You're reading a serialized object stream. That has a lot more stuff in it than just the table name. I'm guessing that the SQL engine is seeing all that stuff and having a problem with it.
    This code can create tables:
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.Statement;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.List;
    public class TableCreator
        public static final String DEFAULT_SQL  = "CREATE TABLE TEST(NAME TEXT(80))";
        public static final String DRIVER       = "sun.jdbc.odbc.JdbcOdbcDriver";
        public static final String DATABASE     = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\Edu\\Java\\Forum\\DataConnection.mdb";
        public static final String USERNAME     = "admin";
        public static final String PASSWORD     = "";
        public static void main(String [] args)
            try
                String tableCreationSQL = ((args.length > 0) ? args[0] : DEFAULT_SQL);
                String driver           = ((args.length > 1) ? args[1] : DRIVER);
                String url              = ((args.length > 2) ? args[2] : DATABASE);
                String username         = ((args.length > 3) ? args[3] : USERNAME);
                String password         = ((args.length > 4) ? args[4] : PASSWORD);
                Class.forName(driver);
                Connection connection   = DriverManager.getConnection(url, username, password);
                Statement statement     = connection.createStatement();
                statement.executeUpdate(tableCreationSQL);
                statement.close();
                connection.close();
            catch (ClassNotFoundException e)
                System.err.println("Couldn't load JDBC driver class");
                e.printStackTrace();
            catch (SQLException e)
                System.err.println("SQL state: " + e.getSQLState());
                System.err.println("SQL error: " + e.getErrorCode());
                e.printStackTrace();
            catch (Exception e)
                e.printStackTrace();
    }Compile it and try it with your own database and creation SQL.
    MOD

  • Exception when trying to use 1-char long table name (or bug in ojdbc?)

    Hello,
    I`ve got exception while trying to prepare SQL statement using "prepareStatement(String sql, String columnNames[])"
    Please have a look at the following test
            Connection con = null;
            String tblName = "k";
            try
                Class.forName("oracle.jdbc.driver.OracleDriver");
                con = DriverManager.getConnection("jdbc:oracle:thin:@oracle:1521:server", "usr", "passwd");
                con.prepareStatement("create table "+tblName+"(id number primary key)").execute();
                PreparedStatement stmt = con.prepareStatement("insert into "+tblName+"(id) VALUES (?)", new String[] {"id"});
                stmt.setInt(1, 1);
                stmt.executeUpdate();
            catch (Exception e)
                e.printStackTrace();
            finally
                try
                    con.prepareStatement("drop table " + tblName).execute();
                    con.close();
                catch (SQLException e)
                    e.printStackTrace();
            }The result of the above is the following stacktrace:
    java.sql.SQLException: Invalid argument(s) in call
         at oracle.jdbc.driver.AutoKeyInfo.getTableName(AutoKeyInfo.java:252)
         at oracle.jdbc.driver.T4CConnection.doDescribeTable(T4CConnection.java:3640)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:6427)
         at X.tst(X.java:22)
         at X.main(X.java:46)Now, if I change tblName to be kk (two characters long), it runs with no exceptions.
    Has anyone ever faced the same problem?
    Looks like a bug in JDBC driver... Or may be it is a known issue which I`m now aware of.
    p.s. I`m using Oracle JDBC v. 11.2.0.1.0.

    Well... this is definitelly not a requirement.
    The code snippet came from the test (junit) for something which is much bigger. And of course the 1-char long table name has nothing to do with desing. At all.
    We have a system where a user defines (named) xml structures, so to say. The structures are then "translated" into DB entities. So the result DB schema is fully auto-generated. The system supports 4 different SQL dialects. Oracle is just one of them.
    Having restrictions like "name of a structure must be at least two characters" is no problem. But I still can`t believe Oracle has such a limitation. It does not sound logical (to me at least). And I had a hope may be someone has an explanation for that thing.
    The code above works just fine if I do not request certain columns back after the statement is executed. (e.g. without the second parameter).
    But anyway... I would post a bug for this, if I knew where to post it to :)
    Thanks.

  • Error ORA-00903 Nome da tabela inválido ( Or in English,Invalid table name)

    Hi people ! Please help me !
    I&acute;m using ODI 10.1.3.4.0 Design and in window MODELS and when I generate service, show this error message:
    java.sql.SLException: ORA-00903: Nome da tabela inv&aacute;lido ( Invalid table name)
    com.sunopsis.tools.core.exception.SnpsRuntimeException: java.sql.SQLException: ORA-00903: nome de tabela inv&aacute;lido
    at com.sunopsis.dwg.dataservices.AbstractWSGenerator.k(AbstractWSGenerator.java)
    at com.sunopsis.dwg.dataservices.AbstractWSGenerator.a(AbstractWSGenerator.java)
    at com.sunopsis.dwg.dataservices.WSGenerationTask.a(WSGenerationTask.java)
    at com.sunopsis.graphical.i.c.b(c.java)
    at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
    at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
    at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: ORA-00903: nome de tabela inv&aacute;lido
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:113)
    at oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:431)
    at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
    at oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:463)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1184)
    at com.sunopsis.dwg.snpreference.c.a(c.java)
    at com.sunopsis.dwg.snpreference.c.&lt;init&gt;(c.java)
    at com.sunopsis.dwg.codeinterpretor.g.a(g.java)
    ... 10 more
    Caused by:
    java.sql.SQLException: ORA-00903: nome de tabela inv&aacute;lido
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:113)
    at oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:431)
    at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
    at oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:463)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1184)
    at com.sunopsis.dwg.snpreference.c.a(c.java)
    at com.sunopsis.dwg.snpreference.c.&lt;init&gt;(c.java)
    at com.sunopsis.dwg.codeinterpretor.g.a(g.java)
    at com.sunopsis.dwg.dataservices.AbstractWSGenerator.k(AbstractWSGenerator.java)
    at com.sunopsis.dwg.dataservices.AbstractWSGenerator.a(AbstractWSGenerator.java)
    at com.sunopsis.dwg.dataservices.WSGenerationTask.a(WSGenerationTask.java)
    at com.sunopsis.graphical.i.c.b(c.java)
    at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
    at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
    at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
    at java.lang.Thread.run(Thread.java:595)
    Where can i do to fix this ?
    Help me please ! ;-) I&acute;m waiting for your messages !
    Thanks !

    Hi Cezar,
    I´m using AXIS2 technology and about KM´s i received a documentation of PTS team "Exercises for Lesson 13 Web Services", this is a course doc. But this isn´t said other required KM (CKM) necessary to my implementation, only SKM Oracle. Ok, when i generate this service, now show this message:
    Erro durante a geração do Serviço de dados
    com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Você deve definir uma fonte de dados para o modelo.
    Pelo seu nome você deve ser brasileiro, podemos discutir em portugues mesmo? Facilitaria bastante as coisas. :-)
    Regards ou abraço !

  • Login table name

    Hi
    When a user logs in to adobe livecycle Rights management, the data will be stored in some table. Can anyone please let me know the table name where this info is stored?
    Also, I have created group of users in admin UI and I want to retrieve the group name in the process. Could anyone please let me know from which table can i get the info?
    Thanks.

    I made something like this as He pasted the the code above and u know this works for me atleast thanx
    kind regards
    satinderjit
    String User[] = new String[1000];
    try
    //Load Driver
    Class.forName(driver);
    // Make Connection
    connection=DriverManager.getConnection(url,user,password);
    // Create Statement
    statement = connection.createStatement();
    sql = "SELECT User FROM Login" ;
    // Create Resultset
    rs = statement.executeQuery(sql);
    int j=0;
    while(rs.next())
    User[j]= rs.getString("User");
    j=j+1;
    for(int i=0 ;i<J;i++)
    Form.C_Manager.addItem(User);
    statement.close();
    //rs.close();
    connection.close();
    catch(ClassNotFoundException cnfex) {
    //show message
    JOptionPane.showMessageDialog((Component) null,
    "Failed to load driver..."+
    "\n"+cnfex.getMessage(),
    "Error...",
    JOptionPane.ERROR_MESSAGE);
    catch(SQLException sqlex){
    //show message
    JOptionPane.showMessageDialog((Component) null,
    "Unable to connect to Database..."+
    "\n"+sqlex.getMessage(),
    "Error...",
    JOptionPane.ERROR_MESSAGE);
    catch(ArrayIndexOutOfBoundsException e){
    //show message
    JOptionPane.showMessageDialog((Component) null,
    "Unable to Load User Name..."+
    "\n"+e.getMessage(),
    "Error...",
    JOptionPane.ERROR_MESSAGE);

Maybe you are looking for

  • Purple line after installing...

    I just recently installed the new update to iTunes and Quicktime. As soon as my computer restarted a single purple vertical line of pixels appeared on my screen, at first it would disappear and appear at random, but now it is just stuck there. It is

  • Standard Forms messages won't display

    I developed 6i forms using the standard template on Oracle 11.5.4. When I run the form within Apps 11i environment I cannot get the standard messages to display. example: '1 record(s) saved' Any help would be appreciated. Phil

  • Error on a input ready query

    Hello SAP Gurus, Can anybody advise on the following error of an input ready query? u2022 Error reading the data of InfoProvider ZIPNA002 - Notification Number DBMAN 305 u2022  Error while reading data; navigation is possible - Notification Number BR

  • Want t-codes

    Hi I want T codes for following- 1.Vendor list for company code. 2.Material code list with price mentioned in material master.

  • Accounting connection of MM document

    Hello Expert, I have filled the T030 table for transaction GBB and general modification ZOB (for example). Given this situation, I have created the MM document. The question is: where I can find the transaction and general modification in MM document