0

How to run this file?

SQLJ-file :

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());
         }
      }
}

I try to run it with jBuilder and IBM Data Studio but execution failed

IBM data studio picture
jBuilder picture execution fail

Taha
  • 1,072
  • 2
  • 16
  • 29
  • In what way did "execution failed"? Please describe what happened, including any error messages you got. – APC May 07 '16 at 09:09
  • In IBM Data Studio I create a javaproject then i create a new SQLJ file. and i added two jar files : db2jcc.jar and db2jcc_license_cu.jar when i click run as a java application i get this error : Selection does not cotain a main type – Taha May 07 '16 at 09:34
  • take a look at this http://i.stack.imgur.com/Bdeyl.png – Taha May 07 '16 at 09:51
  • and this http://i.stack.imgur.com/7cUlH.png – Taha May 07 '16 at 09:57

0 Answers0