sqlite下查找表名是否存在的语句
0 个评论
select name from sqlite_master where type = 'table' and name = 'table_name'
阅读全文
一个检测日期正确与否的javascript代码
0 个评论
function checkData(str) {
var year = /^(19|20|21)[0-9]{2}$/;
var month = /^(0[1-9])|(1[0-2])$/;
var date = /^(0[1-9])|([1-2][0-9])|(3[0-1])$/;
var ystr = str.substring(0, str.length - 4);
var mstr = str.substring(str.length - 4, str.length - 2);
var dstr = str.substring(str.length - 2...
阅读全文
Sqlite下得到列名的方法
0 个评论
1.通过下面的语句得到表的创建语句
select sql from sqlite_master where type = 'table' and tbl_name = 'table_name';
其中table_name是你要替换掉的表名
2.通过分析sql语句得到各列的名称.
下面是python下的一段分析代码:
def isTableExist(self, table_name):
sql = """select name from sqlite_mas...
阅读全文
Ubuntu 9.10 下设置Eclipse支持 GBK/GB2312/GB18030
0 个评论
1.默认情况下Ubuntu安装的Eclipse只支持UTF-8,原因在于他所使用的jdk不是sun的jdk,并不支持GBK/GB2312这些编码格式.所以只需要调整一下Eclipse的JDK就可以实现对中文编码的支持.
2.首先要在locale里添加GBK,GBK2312,GB18030等编码. 通过locale-gen命令生成locales
3. 然后要安装一个sun的jdk,如:
sudo apt-g...
阅读全文