What happened if you drop a table and then create it again?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mattmao
    New Member
    • Aug 2007
    • 121

    What happened if you drop a table and then create it again?

    This is so strange to me...

    Okay, I've finished my web J2EE application several days ago. It worked fine, and the connection to Oracle database was fine as well. I could retrieve the values I like from the tables with no errors.

    I dropped all my tables and created them yesterday, in order to fix a bug in my database design. However, since then my application could access the database but couldn't retrieve any value out of the tables.

    I used the Oracle isqlplus console to check my tables. They are there inside which contain the values.

    There must be something wrong but I cannot figure out which part.

    I am fully a newbie to database, sorry if my words is not best describing the point.


    Thanks for the help in advance.




    Sincerely yours,

    Matt
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    When a table is dropped and recreated it is like a new table. Itr has no link to the dependent objects of the old table. to establish the link u need to recompile all the dependent objects.

    Comment

    • mattmao
      New Member
      • Aug 2007
      • 121

      #3
      Originally posted by debasisdas
      When a table is dropped and recreated it is like a new table. Itr has no link to the dependent objects of the old table. to establish the link u need to recompile all the dependent objects.
      Hi.

      I am using connection pooling. So the only object get linked to database would be DataSourceBean dsb = new DataSourceBean( );
      and the sql statements are of this type:

      ResultSet rs = "SELECT * FROM users "

      I couldn't understand why after I dropped all the tables and recreate them I couldn't retrieve the values there anymore. Like you said these tables would be recognized as new ones, but my statements should hold true regardless of this change so long as the table name is still "users". Yeah, I've recompiled all my java classes(Servlet s and JavaBeans), but still couldn't be able to get the values...

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        try to recompile all the dependent objects at database level and purge the recyclebin if using version Oracle version 10.

        Comment

        • mattmao
          New Member
          • Aug 2007
          • 121

          #5
          Thank you so much debasisdas!

          I will try this out.

          Comment

          Working...