Beispiel #1
0
 def get_client_version() -> str:
     """Gets the SDK version."""
     return AceQLHttpApi.get_client_version()
Beispiel #2
0
    def do_it():

        aceql_http_api = AceQLHttpApi("http://localhost:9090/aceql", "user1", "password1", "sampledb")
        print("connect done!")

        print("client version: " + aceql_http_api.get_client_version())
        print("server version: " + aceql_http_api.get_server_version())

        auto_commit = aceql_http_api.get_auto_commit()
        print("auto_commit: " + str(auto_commit))

        aceql_http_api.set_auto_commit(False)
        auto_commit = aceql_http_api.get_auto_commit()
        print("auto_commit: " + str(auto_commit))

        aceql_http_api.commit()
        aceql_http_api.rollback()
        aceql_http_api.set_auto_commit(True)

        auto_commit = aceql_http_api.get_auto_commit()
        print("auto_commit: " + str(auto_commit))

        holdability = aceql_http_api.get_holdability()
        print("holdability: " + holdability)

        transaction_isolation = aceql_http_api.get_transaction_isolation()
        print("transaction_isolation: " + transaction_isolation)

        read_only = aceql_http_api.is_read_only()
        print("readOnly: " + str(read_only))

        print()
        sql = "update customer set fname = ? where customer_id = ?"
        is_prepared_statement = True

        statement_parameters = {}
        statement_parameters["param_type_1"] = "VARCHAR"
        statement_parameters["param_value_1"] = "Nicolas"
        statement_parameters["param_type_2"] = "INTEGER"
        statement_parameters["param_value_2"] = "1"

        result = aceql_http_api.execute_update(sql, is_prepared_statement, statement_parameters)
        print("result: " + str(result))

        status_code = aceql_http_api.get_http_status_code()
        print("statusCode: " + str(status_code))

        status_message = aceql_http_api.get_http_status_message()
        print("status_message: " + str(status_message))
        print()

        print("UUID: " + FileUtil.get_unique_id())
        print("Home: " + FileUtil.get_user_home_dot_kawansoft_dir())
        print("Tmp : " + FileUtil.get_kawansoft_temp_dir())
        print()

        statement_parameters2 = {}
        statement_parameters2["param_type_1"] = "INTEGER"
        statement_parameters2["param_value_1"] = "0"
        sql = "select * from customer where customer_id >= ? order by customer_id"
        aceql_http_api.set_pretty_printing(True)

        result = aceql_http_api.execute_query(sql, is_prepared_statement, statement_parameters2)
        print("result: " + str(result))
        print()