nutz, Tonight, let's send (4): Nutz's project uses MySQL, and the next morning reported a connection error. What's the reason?

original
2014/12/20 21:13
Reading number 1.1K

Environmental Science:

  1. nutz 1.b.51

  2. MySQL 5.1. x is installed by default and the configuration has not been modified

  3. Dao.js only configures the most basic content (Database driver class name, jdbcurl, user name, password)

  4. Dao.js uses dhcp, c3p0, druid, etc Connection pool implementation

Phenomenon:

Sleep well and get up the next day for the first time After being interviewed and reporting an error, it will be normal


Why? Tell me why ??!!

The answer is still in the next issue. Welcome to answer



--------------------------------------Great dividing line------------------------------------------------------------------

Answer of last issue: Cnd.exps To solve

 Cnd cnd = Cnd.where(Cnd.exps("name","=","wendal").or("name","=","zozoh"))                    .and("age","<",40);


There are others Deprecated writing method , Please carefully erase the sql injection characters (using Sqls. EscapeSqlFieldValue handles unsafe values ) :

Literary writing, using Cnd.wrap

 Cnd cnd = Cnd.wrap("(name='wendal' OR name='zozoh') AND age<40");

Dark cooking: The org. nutz. dao. util. cri. Static class is a dark way to build full static conditions

 Cnd cnd = Cnd.where(new Static("(name='wendal' OR name='zozoh')")).and("age<40");
Expand to read the full text
Loading
Click to join the discussion 🔥 (3) Post and join the discussion 🔥
Reward
three comment
zero Collection
zero fabulous
 Back to top
Top