All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.test.java.com.aceql.client.test.AceQLConnectionTestFourDbs Maven / Gradle / Ivy

Go to download

The AceQL Java Client SDK allows to wrap the AceQL HTTP APIs and eliminate the tedious works of handling communications errors and parsing JSON results. Android and Java Desktop application developers can access remote SQL databases and/or SQL databases in the cloud by simply including standard JDBC calls in their code, just like they would for a local database.

There is a newer version: 5.1
Show newest version
/**
 *
 */
package com.aceql.client.test;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.sql.Connection;
import java.sql.SQLException;

import com.aceql.client.jdbc.AceQLException;
import com.aceql.client.test.connection.FourDbConnections;

/**
 * Class to test all 4 DBs with AceQLConnectionTest
 * @author Nicolas de Pomereu
 *
 */
public class AceQLConnectionTestFourDbs {

    /**
     * Static class
     */
    protected AceQLConnectionTestFourDbs() {

    }

    /**
     * @param args
     */
    public static void main(String[] args)  throws Exception {
	doIt();
    }

    /**
     * @throws SQLException
     * @throws AceQLException
     * @throws FileNotFoundException
     * @throws IOException
     * @throws NoSuchAlgorithmException
     */
    public static void doIt()
	    throws SQLException, AceQLException, FileNotFoundException, IOException, NoSuchAlgorithmException {
	testPostgreSQL();
	testMySQL();
	testSqlServer();
	testOracle();
    }

    /**
     * Get a PostgreSQL Connection and test all.
     * @throws SQLException
     * @throws AceQLException
     * @throws FileNotFoundException
     * @throws IOException
     * @throws NoSuchAlgorithmException
     */
    public static void testPostgreSQL()
	    throws SQLException, AceQLException, FileNotFoundException, IOException, NoSuchAlgorithmException {
	Connection connection = FourDbConnections.getPostgreSQLConnection();
	AceQLConnectionTest.doItPassConnection(connection);
	connection.close();
    }

    /**
     * Get a MySQL Connection and test all.
     * @throws SQLException
     * @throws AceQLException
     * @throws FileNotFoundException
     * @throws IOException
     * @throws NoSuchAlgorithmException
     */
    public static void testMySQL()
	    throws SQLException, AceQLException, FileNotFoundException, IOException, NoSuchAlgorithmException {
	Connection connection = FourDbConnections.getMySQLConnection();
	AceQLConnectionTest.doItPassConnection(connection);
	connection.close();
    }

    /**
     * Get a SQL Server Connection and test all.
     * @throws SQLException
     * @throws AceQLException
     * @throws FileNotFoundException
     * @throws IOException
     * @throws NoSuchAlgorithmException
     */
    public static void testSqlServer()
	    throws SQLException, AceQLException, FileNotFoundException, IOException, NoSuchAlgorithmException {
	Connection connection = FourDbConnections.getSqlServerConnection();
	AceQLConnectionTest.doItPassConnection(connection);
	connection.close();
    }


    /**
     * Get an Oracle Connection and test all.
     * @throws SQLException
     * @throws AceQLException
     * @throws FileNotFoundException
     * @throws IOException
     * @throws NoSuchAlgorithmException
     */
    public static void testOracle()
	    throws SQLException, AceQLException, FileNotFoundException, IOException, NoSuchAlgorithmException {
	Connection connection = FourDbConnections.getSqlServerConnection();
	AceQLConnectionTest.doItPassConnection(connection);
	connection.close();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy