MYSQL的一些小记
下午看了一段PHP100的视频。
也算有点收获。
里面的一段自写的findall的SQL函数:
public function findall($table) {
$this->query("SELECT * from $table");
}
原来只是这么简单,刚还在思考。
使用了TAB键上面的顿号来修饰MYSQL里的字段名,如:
UPDATE tablename SET `fieldname`='values' where `fieldname`='values'
以前都没有这种习惯,直接字段名都不加修饰,看来这是个好习惯。
晚上还要再看一点,好久没有写程序了,又开始有成就感了呵呵。
相关文档:
java中时间戳和时间字符串之间的转换
获取当前的unix时间戳
new Date().getTime()
System.currentTimeMillis()
返回的是毫秒数,要转换long t = System.currentTimeMillis()/1000;
获取当前年月日以及时分秒
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR)) c.get(Calendar.YEAR)) c.get(C ......
最近使用root用户编写了几个存储过程,但是使用普通用户通过JDBC连接执行却报错:
java.lang.NullPointerException......
或
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 " ......
一直使用Mysql,最近才了解到Mysql支持了Transaction。老了,跟不少潮流了。
那就把原来的应用改成Based On Transaction的吧。
将建表语句改成Engine=InnoDB,好像还是不行,没有想象中那么简单。
查一查,哦,发现XAMPP安装的Mysql还要修改conf文件:
XAMPP from Apache Friends is a collection of free open s ......