![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
J2SE
iteye_10198
这个作者很懒,什么都没留下…
展开
-
使用DatabaseMetaData接口和ResultSetMetaData扫描数据库结构
首先是DatabaseMetaData接口: public static void main(String[] args) { //这里没有指定数据库 String url = "jdbc:mysql://127.0.0.1:3306/"; String user = "root"; String pass = ""; try { Class.f...2010-01-07 15:05:44 · 107 阅读 · 0 评论 -
转载:用JavaScript计算字符串占用字节数
最近和JavaScript纠缠上了。 遇到这么一个问题,数据库的字符集为UTF-8的,要在页面上使用JavaScript验证输入的文本用UTF-8存储时占用字节长度。JavaScript的String对象有length属性,但是这个计算的是字符数,不是字节数(问题总是翻来覆去的,记得当年玩Delphi的时候,还得写程序计算字符串的字符数,因为Delphi中String的length是...原创 2010-05-14 11:53:29 · 98 阅读 · 0 评论