Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Yet another beginer help post...

  1. #1
    Junior Member
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    2
    Thanked 1 Time in 1 Post

    Red face Yet another beginer help post...

    I'm reading this book, Java 6 21 days. I have just gotten to the part where you make a JavaDB database.

    I'm using netbeans 6.9 - this I think is part of the problem

    Here's the problem: This program http://workbench.cadenhead.org/book/...residents.java Throws this error
    Error -- java.sql.SQLException: Table/View 'CONTACTS' already exists in Schema 'APP'.

    I realize that its not a java compiler error but an error with the database's creation. I Googled for the error the best i could, and all i could find was this

    Whatever JPA provider you're using, I suspect that it is configured to generate and export the database objects corresponding to your mappings... and those already exist.
     
    Depending on your configuration, on the JPA provider, on the exact message (EclipseLink logs such messages as warning AFAIK), this might be just normal or a "configuration mistake".
     
    If you want more details, please tell us what provider you're using and show your persistence.xml.
     
    Update: As suspected, you are using EclipseLink and these message are "normal" (they are logged as warning if you look closely at the message IIRC)
    at
    java.sql.SQLException: Table/View 'SEQUENCE' already exists in Schema 'ADMIN'. - Stack Overflow

    What do i have to configure, or change to get this example program working?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Yet another beginer help post...

    The error states the table already exists, so my guess is you are trying to create a table or view but can't because it has already been created. So 1) drop the existing table/view (not good if it is a table and has important data in it) or 2) forget creating the table as it already exists, so just insert the data (not good if you do not know the schema). Hope this helps

  3. The Following User Says Thank You to copeg For This Useful Post:

    Gondee (November 14th, 2010)

  4. #3
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Yet another beginer help post...

    Chances are you ran the program once, successfully, and the table was created. As noted by copeg, you can't create the same table in the same schema over and over again.

    db

  5. The Following User Says Thank You to Darryl.Burke For This Useful Post:

    Gondee (November 14th, 2010)

  6. #4
    Junior Member
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Yet another beginer help post...

    Oo, i see. You guys were correct.
    Here i was thinking it was some NetBeans setting lol
    I had mine edited to just do them in sequential order =( For some reason i had to delete the database and re run the program to get it running as you guys said.

    thanks for the help guys!

Similar Threads

  1. Problem sending POST request with Java..
    By lost in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 20th, 2010, 09:16 PM
  2. Java: Handling cookies when logging in with POST
    By cloakbot in forum What's Wrong With My Code?
    Replies: 0
    Last Post: June 16th, 2010, 04:31 PM
  3. Http post to login to forum
    By durenir in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 14th, 2010, 11:03 AM
  4. Post variable set to non-null vlaues
    By ss7 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: November 1st, 2009, 12:04 PM
  5. Replies: 6
    Last Post: October 20th, 2009, 06:33 AM