执行SQLJ文件最简单的方法是什么?

时间:2016-05-06 23:01:14

标签: oracle jbuilder ibm-data-studio sqlj

如何运行此文件?

SQLJ文件:

import java.sql.*;
import sqlj.runtime.ref.*;

public class tes {
    public static void main(String[] args) throws SQLException 
       {
         Oracle.connect
            ("jdbc:oracle:thin:@oow11:5521:sol2", "scott", "tiger");

         #sql { insert into emp (ename, empno, sal)
            values ('SALMAN', 32, 20000) };
         MyIter iter;

         #sql iter={ select ename, empno, sal from emp };
         while (iter.next()) {
            System.out.println
               (iter.ename()+" "+iter.empno()+" "+iter.sal());
         }
      }
}

我尝试使用jBuilder和IBM Data Studio运行它,但执行失败

IBM data studio picture
jBuilder picture execution fail

0 个答案:

没有答案