import com.mysql.jdbc.Driver;一句中com的意思?

jdgdf566 2013-11-03 05:41:34
import com.mysql.jdbc.Driver;一句中com的意思?是通用对象模型吗?

DriverManager创建的对象有没有像PHP里面的
bindValue()
bind_result()
bind_param()
之类的绑定的方法?

...全文
168 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
teemai 2013-11-03
  • 打赏
  • 举报
回复
一般包得命名规则是用 com.公司名.xxx org.组织名.xxx 当然你也可以随便写。
jdgdf566 2013-11-03
  • 打赏
  • 举报
回复
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)里面
jdgdf566 2013-11-03
  • 打赏
  • 举报
回复
引用 1 楼 huxiweng 的回复:
com是包名的一部分! com.mysql.jdbc是包名
我的意思是为什么叫这个名字,为什么不是xyz.mysql.jdbc
teemai 2013-11-03
  • 打赏
  • 举报
回复
com是包名的一部分! com.mysql.jdbc是包名

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧