⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e263. deleting all rows from a database table.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
All the rows in a table can be deleted either by using the TRUNCATE or DELETE SQL statement. TRUNCATE is faster than DELETE since it does not generate rollback information, does not fire any delete trigger, and does not record any information. 
This example deletes all the rows from a database table called my_table. 

    try {
        Statement stmt = connection.createStatement();
    
        // Use TRUNCATE
        String sql = "TRUNCATE my_table";
    
        // Use DELETE
        sql = "DELETE FROM my_table";
    
        // Execute deletion
        stmt.executeUpdate(sql);
    } catch (SQLException e) {
    }

 Related Examples 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -