2013年11月3日星期日

import com.mysql.jdbc.Driver; sentence com mean ?

import com.mysql.jdbc.Driver; sentence com mean ? Is a common object model do ?

DriverManager object created inside there like PHP
bindValue ()
bind_result ()
bind_param ()
like the bound method ?


------ Solution ------------------------------------ --------
package was named general rule is to use
com. company name . xxx
org. organization name . xxx
Of course you can just write .
------ For reference only -------------------------------------- -
com is part of the package name !
com.mysql.jdbc is the package name
------ For reference only -------------------------- -------------

I mean, why is it called that name, why not xyz.mysql.jdbc
------ For reference only - -------------------------------------
PreparedStatement statement = connection.prepareStatement("INSERT INTO TABLEX VALUES(?, ?)");
//记录1
statement.setInt(1, 1);
statement.setString(2, "Cujo");
statement.addBatch();
//记录2
statement.setInt(1, 2);
statement.setString(2, "Fred");
statement.addBatch();
//记录3
statement.setInt(1, 3);
statement.setString(2, "Mark");
statement.addBatch();
//批量执行上面3条语句.
int [] counts = statement.executeBatch();
//Commit it  到(DB)里面

没有评论:

发表评论