[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to Delete an Oracle table using Java?

Posted on 2004-11-08
5
Medium Priority
?
202 Views
Last Modified: 2010-04-17
Thank you in advance.
How do I delete a table inOracle 9i using Java code?
Do I have to append data and use a result set? Or do I have to use prepared statments. If so what statements are necessary to perform a java/Oracle Delete of a table?    
0
Comment
Question by:coolgem
  • 2
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
Mikal613 earned 1000 total points
ID: 12526221
try {
        // Create a statement
        Statement stmt = connection.createStatement();
   
        // Drop table object1_table and types object1 and object2
        stmt.execute("DROP TABLE object1_table");
        } catch (SQLException e) {
        // A drop statement will throw an exception if the table or type does not exist
    }
0
 

Author Comment

by:coolgem
ID: 12526888
Is that different from deleting a record from a table?
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 1000 total points
ID: 12526917
well deleteing a record would just be a different statement

delete * from table where whateverer = 2
0
 
LVL 22

Expert Comment

by:Helena Marková
ID: 12530760
As an addition to Mikal613 - you have to have a permissions for droping table if you want to do it.
0
 

Author Comment

by:coolgem
ID: 12533137
Thnak you Mikal613 & Henka
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question