87e5c8591e89ae2737087326b831e7a20e8d38cc
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / model / TableImpl.java
1 package com.quantum.model;
2
3 import java.sql.SQLException;
4
5 import com.quantum.sql.MultiSQLServer;
6
7
8 class TableImpl extends EntityImpl implements Table {
9     public TableImpl(Bookmark bookmark, String schema, String name) {
10         super(bookmark, schema, name, TABLE_TYPE);
11     }
12     
13     public Integer getSize() {
14         Integer size = null;
15         try {
16             size = new Integer(MultiSQLServer.getInstance().getSize(getBookmark(), 
17                 getBookmark().getConnection(), getQualifiedName(), 
18                     getBookmark().getAdapter()));
19         } catch (SQLException e) {
20         } catch (ConnectionException e) {
21         }
22         return size;
23     }
24     
25     public void deleteAllRows() throws SQLException, ConnectionException {
26         String sql = "DELETE FROM " + getQualifiedName();
27                 MultiSQLServer.getInstance().execute(getBookmark(), getBookmark().getConnection(), sql);
28     }
29 }