JDBC与SQLJ

smilingdeng 2003-02-03 06:28:12
请教各位大侠,小弟初学SQLJ,看书以后里面说SQLJ在进行第一次编译后会产生JAVA源程序与一系列的PROFILE文件,这是不是说,SQLJ在第一次编译后产生的程序就是JAVA程序调用JDBC进行数据库的访问。另外的问题是,SQLJ中的内嵌的SQL语句一定是静态调用吗?
...全文
34 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
dou1204 2003-02-04
  • 打赏
  • 举报
回复
SQLJ is a recent ANSI standard for embedding static SQL statements directly in Java code. the mixed code is converted to Java by the SQLJ translator, and can be executed on a database using the SQLJ runtime library and an underlying JDBC driver.
SQL statements in SQLJ are static; that is,they must be known at program time and can not change as the program executes. Data values passed to SQL operations can be deternined at runtime but the SQL operation is known a priori. in contrast, the JDBC API is fully dynamic--the SQL statement itself can be formulated on the fly.Most SQL operations in a typical database qapplication are static. SQLJ provides a simpler model for static SQL statements compared to JDBC, and provides higher-level interface by automatically managing JDBC statement handles. Additionally, the SQLJ translator can check the SQL statements against a database for syntax and semantic errors. This checking is performed ar compile-time unlike just at runtime as in JDBC, and it is independent of the actual flow of program logic.compared to JDBC, SQLJ programs are therefore more robust, much quicker to write and easier to maintain.

17,134

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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