Here is the Java method for parsing an XML file present within documentum. In this case JDOM has been used for the parsing purpose . Other Document parsers can also be used.
/*The argument of the method is the documentum session object and r_object_id of the xml document. The method returns a org.jdom.Document object which can then be used to parse the XML file (ref: http://www.jdom.org/) .*/
private Document parseXML(IDfSession losession,String r_object_id)
{
IDfSysObject xmlObj =null;
Document document=null;
try
{
xmlObj =(IDfSysObject) losession.getObject(new DfId(r_object_id));
System.out.println("objectname= "+xmlObj.getObjectName());
ByteArrayInputStream bis=xmlObj.getContent();
/*getContent() method returns a ByteArrayInputStream object of the file present in
content server. This method is also helpful in reading files having other extensions. */
SAXBuilder builder = new SAXBuilder();
document = builder.build(bis);
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
return document;
}
}
Thursday, April 17, 2008
Sunday, September 23, 2007
MySQL Error Number 1045 ( Access denied for user username@servername )
Recently I faced this error while logging in to MySQL Query Browser after installing MySQL Server.
The solution is as follows:
1. Server,username,password is stored in user table of a database named mysql. Login to the MySQL CommandLine Client and run the following query :
select host,user,password from mysql.user; (password is encripted)
2.Grant permision to the perticular user who wants to login by the following command.
GRANT ALL ON database.* TO username@server_name IDENTIFIED BY password
e.g: GRANT ALL ON mysql.* TO 'root'@'localhost' IDENTIFIED BY '123india' ;
Query OK, 0 rows affected (0.00 sec)
NOTE: If you dont know the password just enter any password of your choice in the "GRANT ALL" command above.That will be your new password.
Any sort of suggestion or comment is welcome.
The solution is as follows:
1. Server,username,password is stored in user table of a database named mysql. Login to the MySQL CommandLine Client and run the following query :
select host,user,password from mysql.user; (password is encripted)
2.Grant permision to the perticular user who wants to login by the following command.
GRANT ALL ON database.* TO username@server_name IDENTIFIED BY password
e.g: GRANT ALL ON mysql.* TO 'root'@'localhost' IDENTIFIED BY '123india' ;
Query OK, 0 rows affected (0.00 sec)
NOTE: If you dont know the password just enter any password of your choice in the "GRANT ALL" command above.That will be your new password.
Any sort of suggestion or comment is welcome.
Subscribe to:
Posts (Atom)