SQL over HTTP for All

Imagine you could connect from all devices (mobile, tablets, PCs) to your remote or Cloud databases with the simplest language, that you already know: SQL.
This is now a reality with AceQL HTTP. Just develop regular SQL calls with your usual C# or Java IDE. We take care of all protocol, communications and security aspects.
Evaluate by downloading our Open Source AceQL HTTP Edition and following our Quick Start.

AceQL HTTP is a secure framework that provides access to remote or cloud based SQL databases through REST style HTTP APIs. It can thus be used in any language that supports HTTP calls.

AceQL HTTP is FREE and Open Source for access to Open Source SQL databases (LGPL license).

Two supplied SDK clients allow encapsulation of the HTTP APIs.
Zero learning curve, zero time wasted:

C# / Xamarin Client SDK

Allows SQL calls to be encoded with a standard C# SQL API: the syntax is identical to the MS SQL Server C# API.

Java Client SDK

Allows SQL calls to be encoded with standard unmodified JDBC syntax (java.sql package interfaces).


The SDKs are licensed under Apache 2.0: you can use them in your commercial software freely and without any constraint.


Free yourself
from Web Services

Tired of writing, testing and deploying Web Services?
Of managing the server code, the client code, and finally the client-server dialog?

With AceQL HTTP you only code the client part to access the remote SQL data.

The framework takes care of all the complex aspects of the client-server dialog (communications, data parsing, error detection).

Make portability and
access to your data easy

Fed up of having to rewrite your code when migrating to new environments?

Migrate your existing C# SQL and Java JDBC application code easily and quickly to many types of desktop OS and mobile / tablet OS.

Do you have a new SQL database? It can be made available to all your applications in just a few moments.

Reduce your costs and increase
your competitiveness

With AceQL HTTP, no dual client-server programming.
No server-side recompilation or redeployment.

Writing desktop and mobile apps to access remote or cloud based SQL data is more reliable, simpler and faster with AceQL HTTP.

Your development times and maintenance costs are reduced.

These gains accelerate the time to market of your apps, giving you a competitive advantage.

Manage your data
securely and easily

AceQL HTTP is a 3 tier architecture and includes a very complete security manager:

  • You freely choose and configure your strong authentication system to protect your SQL databases.
  • You control the syntax and parameters of incoming SQL commands.
  • You trigger the actions in the event of unexpected SQL commands.

Your SQL data moves via SSL and is protected from hackers.


Easy Access to Remote SQL Database

SQL Over HTTP Code Samples

Here are examples in cURL, C# / Xamarin and Java/JDBC.

cURL Samples

So via cURL we connect to a remote or Cloud SQL database kawansoft_example with the identifiers (MyUsername, MySecret):

curl \
https://www.acme.com:9443/aceql/database/kawansoft_example/username/MyUsername/connect?password=MySecret



The command returns a JSON stream with a unique session identifier:

{                                             
    "status":"OK",                            
    "session_id":"mn7andp2tt049iaeaskr28j9ch" 
}                                             



We will use the session identifier to authenticate all subsequent SQL calls.

Following sample shows how to insert a new customer into a remote or Cloud SQL database: just do it with HTTP !

curl --data-urlencode \
 "sql=insert into customer values (1, 'Sir', 'John', 'Doe', '1 Madison Ave', 'New York', 'NY 10010', NULL)" \
https://www.acme.com:9443/aceql/session/mn7andp2tt049iaeaskr28j9ch/execute_update



And your remote SQL database answers via AceQL:

{                    
    "status":"OK",   
    "row_count":1    
}                                     



We view the inserted customer:

curl --data "pretty_printing=true" --data-urlencode \
 "sql=select customer_id, customer_title, lname from customer where customer_id = 1" \
https://www.acme.com:9443/aceql/session/mn7andp2tt049iaeaskr28j9ch/execute_query



This returns the JSON stream:

{                                          
    "status":"OK",                         
    "query_rows":[                         
        {                                  
            "row_1":[                      
                {                          
                    "customer_id":1        
                },                         
                {                          
                    "customer_title":"Sir "
                },                         
                {                          
                    "lname":"Doe"          
                }                          
            ]                              
        }                                  
    ],                                     
    "row_count":1                          
} 



The client's first name is wrong, it's Jim and not John. Let's change it with a Prepared Statement:

curl --data "prepared_statement=true" \
--data "param_type_1=VARCHAR&param_value_1=Jim" \
--data "param_type_2=INTEGER&param_value_2=1" \
--data-urlencode "sql=update customer set fname = ? where customer_id = ?" \
https://www.acme.com:9443/aceql/session/mn7andp2tt049iaeaskr28j9ch/execute_update


Which returns:

{                    
    "status":"OK",   
    "row_count":1    
}                                     


Access to a remote SQL database via http with C# / Xamarin: Samples

Here is the execution of the same remote SQL database operations in C# and Xamarin with the C# Client SDK:

So we connect to the remote SQL database kawansoft_example with the identifiers (MyUsername, MySecret):

    string server = "https://www.acme.com:9443/aceql";
    string database = "kawansoft_example";

    string connectionString = $"Server={server}; Database={database}";

    String username = "MyUsername";
    char[] password = { 'M', 'y', 'S', 'e', 'c', 'r', 'e', 't'};

    AceQLConnection connection = new AceQLConnection(connectionString)
    {
        Credential = new AceQLCredential(username, password)
    };

    // Opens the connection with the SQL remote database
    await connection.OpenAsync();


We insert a client into the SQL database:

      string sql = "insert into customer values (1, 'Sir', 'John', 'Doe', " +
        "'1 Madison Ave', 'New York', 'NY 10010', NULL)";

      using (AceQLCommand command = new AceQLCommand(sql, connection))
      {
         int rows = await command.ExecuteNonQueryAsync();
      }


We view the inserted client:

    string sql = "select customer_id, customer_title, lname from customer where customer_id = 1";

    using (AceQLCommand command = new AceQLCommand(sql, connection))
    using (AceQLDataReader dataReader = await command.ExecuteReaderAsync())
    {
        while (dataReader.Read())
        {
            Console.WriteLine();
            int i = 0;
            Console.WriteLine("customer_id   : " + dataReader.GetValue(i++));
            Console.WriteLine("customer_title: " + dataReader.GetValue(i++));
            Console.WriteLine("lname         : " + dataReader.GetValue(i++));
        }
    } 


Which returns:

customer_id   : 1
customer_title: Sir
lname         : Doe



The client's first name is wrong, it's Jim and not John. Let's change it with a Prepared Statement:

    string sql = "update customer set fname = @fname where customer_id = @customer_id";

    using (AceQLCommand command = new AceQLCommand(sql, connection))
    {
        command.Prepare();
        command.Parameters.AddWithValue("@customer_id", 1);
        command.Parameters.AddWithValue("@fname", "Jim");

        int rows = await command.ExecuteNonQueryAsync();
        Console.WriteLine("Rows updated: " + rows);
    }


Which returns:

Rows updated: 1



And since the C# SDK is a Xamarin-compatible PCL (Portable Class Library), the C# code can be deployed across many OSs:

  • Android.
  • iOS.
  • macOS.
  • Windows Desktop.
  • Windows Phone.


Access to a remote SQL database via http with Java/JDBC: Samples

Here is the execution of the same SQL database operations in Java with the AceQL Java Client SDK :

So we connect to the remote SQL database kawansoft_example with the identifiers (MyUsername, MySecret):

      String server = "https://www.acme.com:9443/aceql";
      String database = "kawansoft_example";

      String username = "MyUsername";
      char[] password = { 'M', 'y', 'S', 'e', 'c', 'r', 'e', 't' };

	// Attempt to establish a connection to the remote SQL database:
      Connection connection = new AceQLConnection(server, database, username,
		password);


We insert a client into the SQL database:

      String sql = "insert into customer values (1, 'Sir', 'John', 'Doe', "
		+ "'1 Madison Ave', 'New York', 'NY 10010', NULL)";

      Statement statement = connection.createStatement();
      int rows = statement.executeUpdate(sql);
	
      statement.close();


We view the inserted client:

customer_id   : 1
customer_title: Sir
lname         : Doe



The client's first name is wrong, it's Jim and not John. Let's change it with a Prepared Statement:

    String sql = "update customer set fname = ? where customer_id = ?";
    PreparedStatement prepStatement = connection.prepareStatement(sql);
    prepStatement.setString(1, "Jim");
    prepStatement.setInt(2, 1);

    int rows = prepStatement.executeUpdate();
    System.out.println("Rows updated: " + rows);

    prepStatement.close();


Which returns:

Rows updated: 1



You can now run the Quick Start to quickly test the software.
And you can also check out the documentation to learn how to use all AceQL HTTP options:

  • Error and SQL Exceptions handling.
  • Proxy setting.
  • Timeout setting.
  • SQL Transaction management.
  • Insert BLOB into a remote SQL database.
  • Reading BLOB from a remote SQL database