// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using System.Reflection; using java.lang; using java.sql; namespace IKVM { public class Program { public static void Main(string[] args) { ikvm.runtime.Startup.addBootClassPathAssembly(Assembly.Load("ojdbc6")); // necessary for Class.forName to work Class.forName("oracle.jdbc.OracleDriver"); Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "arne", "xxxxxx"); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT f1,f2 FROM t1"); while(rs.next()) { int f1 = rs.getInt(1); string f2 = rs.getString(2); Console.WriteLine(f1 + " " + f2); } con.close(); } } }