From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
Use with the Oracle plug-in to connect to an Oracle database.
Oracle 8i and above are supported. The Oracle OCI client 9i or later must be installed.
In order to use this class, you must have the OraclePlugin database plug-in in your plugins folder.
The OracleDatabase engine supports all four RecordSet navigation methods: MoveFirst, MoveNext, MovePrevious, and MoveLast.
SQLSelect and SQLExecute statements do not block when called from within Threads.
Oracle databases cannot be accessed from Xojo Cloud.
In order to use OracleDatabase, you need to install the Oracle Instant Client which can be downloaded from here:
- Linux Instant Client Downloads x86 (Use version 10.1 for best results.)
- Windows Instant Client Downloads x86
- macOS Instant Client Downloads
You'll also need to make sure that your system path contains the folder with the Oracle Instant Client.
The following code connects to an Oracle Express database hosted at 10.0.1.14:
db.DatabaseName = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.1.14)(PORT=1521))(CONNECT_DATA=(SID=XE)))"
db.UserName = "SYSTEM"
db.Password = "dbexample"
db.Debug = 1
MessageBox("Connected to Oracle!")
Catch error As DatabaseException
MessageBox("Error connecting to Oracle: " + error.Message)