Farwa Waheed
Farwa Waheed

Reputation: 3

Why SQL_INVALID_AUTHORIZATION error in GridDB?

I am working with GridDB and trying to connect to a container using the following configuration:

Host: 192.168.0.1
Port: 10001
Username: Farwa_USR
Password: Allah_123@
Container: Farwa_container

I am using a Java client to connect, and the code snippet is as follows:

import com.toshiba.mwcloud.gs.*;

public class GridDBConnection {
    public static void main(String[] args) {
        try {
            // Connection properties
            Properties props = new Properties();
            props.setProperty("host", "192.168.0.1");
            props.setProperty("port", "10001");
            props.setProperty("clusterName", "defaultCluster");
            props.setProperty("username", "Farwa_USR");
            props.setProperty("password", "Allah_123@");

            GridStoreFactory factory = GridStoreFactory.getInstance();
            GridStore store = factory.getGridStore(props);

            // Attempt to retrieve the container
            Container<Object, Row> container = store.getContainer("Farw_container");

            if (container == null) {
                System.out.println("Container not found.");
            } else {
                System.out.println("Connected to container successfully.");
            }

            store.close();
        } catch (GSException e) {
            e.printStackTrace();
        }
    }
}

When I run this, I get the following error:

SQL_INVALID_AUTHORIZATION

ERROR Authentication failed. User name or password may be wrong. Check if the user name and password are correct.

Upvotes: 0

Views: 13

Answers (0)

Related Questions