Skip to main content

Posts

Showing posts from July, 2013

Loading contents dynamically in to jQuery Dialog

var $dialog = $("#html-div").html("Loading...")    // can use  image         .dialog({             autoOpen: false,             title:"Title",             modal: true,             width: 750,             height : 300         })         .load(ActionUrl",{                       param1:value1,               // setting parameter values to send to server             param2:value2         },function(){                    // write events for loaded  contents                   });                 $dialog.dialog( "open" );    // open the dialog box

How to access metadata in MySql from Java application (User does not have access to metadata ,SQLException)

When you get an error message like: java.lang.Exception: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types. Ans: Please use the below connection string settings:  private Connection con;  String connectionURL = "jdbc:mysql://<ip address>:3306/<database name>?user=<username>&password=<password>&noAccessToProcedureBodies=true"; con = DriverManager.getConnection(connectionURL);

Connecting to MySql Server Remotely

When you get an error message like this: javax.security.sasl.AuthenticationException:  Database Error: java.sql.SQLException: null,  message from server: "Host 'xx.xx.xx.xx' is not allowed to connect to this MySQL server" It show that you are not configured the MySql Server correctly. To configure a MySql Server for accessing remotely you need to grant permission for the client in the Server. Here is the Linux command line codes: root@server:~#  mysql -u<username> -p<password>       - log in to MySql > grant all on cheque_alert.* to '<user>'@'<IP address of remote system>'; This will grant all permission to the client machine from the IP:xxx.xxx.xx.xxx To view the permission for any client: > SHOW GRANTS FOR '<user>'@'xxx.xxx.xx.xxx';   eg.: SHOW GRANTS FOR 'root'@'11.111.105.111'; To remove the Grant/permission :  > DROP USER '<user>'@'xxx.xxx.xx