Hello,
I have written a DatabaseManager class that controls access to a locally stored database, implemented in mysql. In theory, client request should be passed to the DatabaseManager through RMI, but I cannot even create a connection to the database yet!
Here's my connect statement:
con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/media", "mysql", "mysql"
When this statement is executed, the following exception is produced:
java.sql.SQLException: Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
Can somebody explain to me how I successfully create a connection to the database? I would be extremely grateful. Also, could somebody explain how I could connect to the database from a remote machine using the following connect statement:
con = DriverManager.getConnection("jdbc:mysql://server:3306/media", "mysql", "mysql"
I have a feeling I need to grant a certain PropertyPermission in my policy file, but I'm unsure of what values I should be using.
Thank you in advance.
Pete
I have written a DatabaseManager class that controls access to a locally stored database, implemented in mysql. In theory, client request should be passed to the DatabaseManager through RMI, but I cannot even create a connection to the database yet!
Here's my connect statement:
con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/media", "mysql", "mysql"
When this statement is executed, the following exception is produced:
java.sql.SQLException: Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
Can somebody explain to me how I successfully create a connection to the database? I would be extremely grateful. Also, could somebody explain how I could connect to the database from a remote machine using the following connect statement:
con = DriverManager.getConnection("jdbc:mysql://server:3306/media", "mysql", "mysql"
I have a feeling I need to grant a certain PropertyPermission in my policy file, but I'm unsure of what values I should be using.
Thank you in advance.
Pete