Read host, db, user, table name and table privilege from privilege table
Friday, January 30th, 2009
SELECT host, db, user, table_name, table_priv, column_priv
FROM tables_priv WHERE user=‘myuserName‘;
SELECT host, db, user, table_name, table_priv, column_priv
FROM tables_priv WHERE user=‘myuserName‘;
import java.awt.BorderLayout;
import java.text.DateFormatSymbols;
import java.util.Locale;
import javax.swing.JFrame;
import javax.swing.JSpinner;
import javax.swing.SpinnerDateModel;
import javax.swing.SpinnerListModel;
import javax.swing.SpinnerModel;
public class MainClass {
public static void main(String args[]) {
JFrame f = new JFrame("JSpinner Sample");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
DateFormatSymbols symbols = new DateFormatSymbols(Locale.FRENCH);
String days[] = symbols.getWeekdays();
SpinnerModel model1 = new SpinnerListModel(days);
SpinnerModel model2 = new SpinnerDateModel();
JSpinner spinner1 = new JSpinner(model1);
JSpinner spinner2 = new JSpinner(model2);
f.add(spinner1, BorderLayout.NORTH);
f.add(spinner2, BorderLayout.SOUTH);
f.setSize(300, 100);
f.setVisible(true);
}
}
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.MissingResourceException;
public class Animals {
public static void main(String [] argv) {
ResourceBundle animalResources;
try {
animalResources = ResourceBundle.getBundle("AnimalResources", Locale.getDefault());
System.out.println(animalResources.getString("Animals"));
} catch (MissingResourceException mre) {
mre.printStackTrace();
}
}
}
# Sample properties file with keys whose values span more than one line
#
Animals=Cat, Dog, Giraffe, \
Bear, Moose
import java.io.StringWriter;
import java.io.Writer;
import java.util.Date;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
public class VMDemo {
public static void main(String[] args) throws Exception {
Velocity.init();
Template t = Velocity.getTemplate("./src/VMDemo.vm");
VelocityContext ctx = new VelocityContext();
ctx.put("aDate",new Date());
Writer writer = new StringWriter();
t.merge(ctx, writer);
System.out.println(writer);
}
}
————————————————————————————-
Hello $aaDate.getDate()
<html>
<head>
<title>Using printf() to format a list of product prices</title>
</head>
<body>
<?php
$products = Array("Pencil"=>"222.4",
"Cake"=>"4",
"Coffee table"=>80.6
);
print "<pre>";
printf("%-20s%23s\n", "Name", "Price");
printf("%’-43s\n", "");
foreach ( $products as $key=>$val )
printf( "%-20s%20.2f\n", $key, $val );
printf("</pre>");
?>
</body>
</html>