Skip to content

Instantly share code, notes, and snippets.

@cx20
Created June 10, 2012 14:33
Show Gist options
  • Save cx20/2905936 to your computer and use it in GitHub Desktop.
Save cx20/2905936 to your computer and use it in GitHub Desktop.
Hello, SQLJ World!
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