Thursday, May 5, 2011

Connecting database MySQL to aglet

Hello, this my first post in english. hope not to bad and you all understand what i mean Photobucket

My project is about aglet. aglet is java technology with mobile agent. aglet(agent and aplet) is technology mobile agent concepts in programming. There is many advantages using mobile agent concepts, you can search in google because i don't explained in here.

Ok back to topic..

When we use aglet to connecting MySQL there is few steps like :
1. Make sure you have mysql-connector-java.jar. you can download in here
2. Place file mysql-connector-java.jar in lib directory of aglet. example : aglets\lib
3. Make connection in your aglet code to connection MySQL
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/cobadb","root","");
4. Then add code like below in .aglet\security\aglets.policy. Place that file in your user.home. example in my computer is c:\users\scy\.aglets\security\aglets.policygrant
{
permission java.net.SocketPermission "localhost:3306", "listen,accept,connect,resolve";
};
5. Just compile your code and running in tahiti. it should be work

If you have any questions you can ask here and if i know i try to answer as i can.

Hope this helpfull Photobucket">

Read More..