Created
June 10, 2012 14:33
-
-
Save cx20/2905936 to your computer and use it in GitHub Desktop.
Hello, SQLJ World!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
import oracle.sqlj.runtime.Oracle; | |
#sql iterator MessageIter ( String MESSAGE ); | |
class Hello { | |
public static void main( String[] args ) throws Exception { | |
Oracle.connect("jdbc:oracle:oci:@", "scott", "tiger"); | |
MessageIter iter; | |
#sql iter = { SELECT 'Hello, SQLJ World!' AS Message FROM DUAL }; | |
while ( iter.next() ) { | |
System.out.println( iter.MESSAGE() ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment