How to connect to an oracle database using Haxe

Viewed 133

is it possible to connect to the most recent oracle database using Haxe? After, googling for a while I am unable to find a solution. I am a Haxe newbie so forgive me if the answer is obvious. I will be targeting both C# and Java

1 Answers

In the Java target you can use JDBC, in the java.db and java.sql packages:

#if java
    var conn = java.db.JDBC(java.sql.DriverManager.getConnection("connection details"));
    var result = conn.createStatement().executeQuery("Select * from Users;");
#else
    trace("Not implemented");
#end

You need an Oracle JDBC driver.

In C# I think you should use ODBC, but I could find only an old project (nODBC) and I don't know if it works anymore. If you know how to do it in C# you can always use raw untyped code:

#if cs
    var result = untyped __cs__("the raw code in c#");
#end
Related