liveconnect mysql
fara fara <[email protected]> Wed, 3 Mar 2010 08:32:17 -0800 (PST)
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
can anyone give me a function like the one below that is capable to
connect to a mysql database, and take SQl interogation and pass it to
mysql server and after mysql server answer... return the result of
interogation...(i think is not so hard to make this function, but i
only know javascript, some PHP and some SQL...) the code below is for
writing in a file (i finded on internet, and sorry for my bad
english)...
// Write text to a file.
function writeFile(fileName, data)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalPropertyRead");
var userHome = java.lang.System.getProperty("user.home");
var fileSeparator = java.lang.System.getProperty("file.separator");
fileName = (fileName || "output.txt");
fileName = (-1 == fileName.indexOf(fileSeparator) ) ? userHome +
fileSeparator + fileName : fileName; // put in home path if no path
specified.
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileAccess");
var fstream = new java.io.FileWriter(fileName);
var output = new java.io.BufferedWriter(fstream);
output.write(data);
output.close();
}