Skip to content

Instantly share code, notes, and snippets.

@bojanrajkovic
Created November 5, 2010 20:13
Show Gist options
  • Save bojanrajkovic/664713 to your computer and use it in GitHub Desktop.
Save bojanrajkovic/664713 to your computer and use it in GitHub Desktop.
using System;
using oracle.jdbc.driver;
using java.sql;
using System.Diagnostics;
using System.Collections.Generic;
namespace IKVMTest
{
class MainClass
{
public static void Main (string[] args)
{
Stopwatch s = new Stopwatch ();
s.Start ();
List<object> l = new List<object> ();
java.sql.DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver ());
Connection c = DriverManager.getConnection ("jdbc:oracle:thin:@database-host-on-vpn:1521:SID", "scott", "tiger");
Statement stmt = c.createStatement ();
ResultSet rset = stmt.executeQuery("select * from table");
while (rset.next())
l.Add (new { Number = rset.getInt (1) });
stmt.close();
s.Stop ();
Console.WriteLine (l.Count);
Console.WriteLine (s.Elapsed);
}
}
}
using System;
using System.Collections.Generic;
using System.Data.OracleClient;
using System.Diagnostics;
class Test {
static void Main (string[] args) {
Stopwatch s = new Stopwatch ();
s.Start ();
List<object> o = new List<object> ();
var oconn = new OracleConnection ("Data Source=database-host-on-vpn/SID; User Id=scott; Password=tiger;");
oconn.Open ();
var ocomm = oconn.CreateCommand ();
ocomm.CommandText = "select * from table";
var oreader = ocomm.ExecuteReader ();
while (oreader.Read ()) {
o.Add (new { Number = oreader.GetValue (0) });
}
s.Stop ();
Console.WriteLine (o.Count);
Console.WriteLine (s.Elapsed);
}
}
saul:Debug bojanrajkovic$ mono IKVMTest.exe
1193
00:00:04.8207610
saul:Debug bojanrajkovic$ cd
saul:~ bojanrajkovic$ mono test.exe
1193
00:00:17.7508020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment