Skip to main content

Posts

Showing posts with the label Drop Table

JDBC application For Dropping table

 JDBC application For Dropping table For Explanation Watch Video::: Before Execution Of code:: SQL> desc test2;  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  EID                                                NUMBER(38)  ENAME                                              VARCHAR2(10) Code::: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.*; public class College { public static void main(String[] args)throws Exception{ Connection con =  DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","tiger"); Statement st = con.createStatement(); //query String query = "drop table test2"; //execute the query int count = st.executeUpdate(query); if(count==0){ System.out.println("Table is dropped