Package org.sd_network.db

Examples of org.sd_network.db.ConnectionPool


     */
    public static final long getFileSize(String fileID) {
        if (fileID == null)
            throw new NullPointerException("fileID.");

        ConnectionPool pool = ConnectionPool.getInstance("vfssector");
        Connection con = pool.engageConnection(10);
        PreparedStatement stmt = null;
        try {
            stmt = con.prepareStatement(
                    "SELECT sum(size) as total_bytes " +
                    "FROM sector " +
View Full Code Here


     */
    public static final long getTotalSectorNumber(String fileID) {
        if (fileID == null)
            throw new NullPointerException("fileID");

        ConnectionPool pool = ConnectionPool.getInstance("vfssector");
        Connection con = pool.engageConnection(10);
        PreparedStatement stmt = null;
        try {
            stmt = con.prepareStatement(
                    "SELECT count(*) as total_sector_number " +
                    "FROM sector " +
View Full Code Here

     */
    public static final String[] getSectorIDs(String fileID) {
        if (fileID == null)
            throw new NullPointerException("fileID");

        ConnectionPool pool = ConnectionPool.getInstance("vfssector");
        Connection con = pool.engageConnection(10);
        PreparedStatement stmt = null;
        try {
            stmt = con.prepareStatement(
                    "SELECT sector_id FROM sector " +
                    "WHERE file_id=? " +
View Full Code Here

     *
     * @throws  DBException
     *          �f�[�^�x�[�X�A�N�Z�X���ɃG���[�����������ꍇ�ɃX���[���܂��B
     */
    public static final long getUsedBytes() {
        ConnectionPool pool = ConnectionPool.getInstance("vfssector");
        Connection con = pool.engageConnection(10);
        PreparedStatement stmt = null;
        try {
            stmt = con.prepareStatement(
                    "SELECT sum(size) as used_bytes FROM sector");
            ResultSet rs = stmt.executeQuery();
View Full Code Here

     */
    private static final boolean exists(String sectorID) {
        if (sectorID == null)
            throw new NullPointerException("sectorID.");

        ConnectionPool pool = ConnectionPool.getInstance("vfssector");
        Connection con = pool.engageConnection(10);
        PreparedStatement stmt = null;
        try {
            stmt = con.prepareStatement(
                    "SELECT sector_id FROM sector WHERE sector_id=?");
            stmt.setString(1, sectorID);
View Full Code Here

        if (fileID == null || fileID.trim().length() == 0)
            throw new IllegalArgumentException("fileID is empty.");
        if (ownerID == null || ownerID.trim().length() == 0)
            throw new IllegalArgumentException("ownerID is empty.");

        ConnectionPool pool = ConnectionPool.getInstance("vfs");
        Connection con = pool.engageConnection(10);
        try {
            PreparedStatement stmt = con.prepareStatement(
                    "SELECT count(*) as number_of_child " +
                    "FROM vfs_file " +
                    "WHERE parent_file_id=? AND owner_id=?");
View Full Code Here

        if (fileID == null || fileID.trim().length() == 0)
            throw new IllegalArgumentException("fileID is empty.");
        if (ownerID == null || ownerID.trim().length() == 0)
            throw new IllegalArgumentException("ownerID is empty.");

        ConnectionPool pool = ConnectionPool.getInstance("vfs");
        Connection con = pool.engageConnection(10);
        try {
            PreparedStatement stmt = con.prepareStatement(
                    "SELECT file_id, name, type_id, parent_file_id, size, " +
                    " owner_id, created " +
                    "FROM vfs_file " +
View Full Code Here

        if (fileName == null || fileName.trim().length() == 0)
            throw new IllegalArgumentException("fileName is empty.");
        if (ownerID == null || ownerID.trim().length() == 0)
            throw new IllegalArgumentException("ownerID is empty.");

        ConnectionPool pool = ConnectionPool.getInstance("vfs");
        Connection con = pool.engageConnection(10);
        try {
            PreparedStatement stmt = con.prepareStatement(
                    "SELECT file_id, name, type_id, parent_file_id, size, " +
                    " owner_id, created " +
                    "FROM vfs_file " +
View Full Code Here

        if (parentFileID == null || parentFileID.trim().length() == 0)
            throw new IllegalArgumentException("parentFileID is empty.");
        if (ownerID == null || ownerID.trim().length() == 0)
            throw new IllegalArgumentException("ownerID is empty.");

        ConnectionPool pool = ConnectionPool.getInstance("vfs");
        Connection con = pool.engageConnection(10);
        try {
            PreparedStatement stmt = con.prepareStatement(
                    "SELECT file_id, name, type_id, parent_file_id, size, " +
                    " owner_id, created " +
                    "FROM vfs_file " +
View Full Code Here

        return create(con, name, 2, parentID, size, ownerID);
    }


    public static final void delete(String fileID, String ownerID) {
        ConnectionPool pool = ConnectionPool.getInstance("vfs");
        Connection con = pool.engageConnection(10);
        try {
            con.setAutoCommit(true);
            delete(con, fileID, ownerID);
        } catch (SQLException e) {
            throw new DBException(e);
View Full Code Here

TOP

Related Classes of org.sd_network.db.ConnectionPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.