Document Type | Technical Information
Category | Migration
Applicable Product Version | 6FS07, 6FS07PS, 7FS02, 7FS02PS
Document Number | TMITI031
Overview
This document explains how to modify interfaces and application queries when converting from Oracle to Tibero.
Method
1. Interface Modification
1) JDBC
Copy the tibero(conversion version)-jdbc.jar driver from the $TB_HOME/client/lib/jar folder to the application's driver management folder.
--ORACLE
String jdbc_url = "jdbc:oracle:thin:@127.0.0.1:1521:ORCL";
String user = "oracle_username";
String passwd = "oracle_passwd";
Class.forName("oracle.jdbc.driver.OracleDriver");
--TIBERO
String jdbc_url = "jdbc:tibero:thin:@127.0.0.1:8629:tibero";
String user = "tibero_username";
String passwd = "tibero_passwd";
Class.forName("com.tmax.tibero.jdbc.TbDriver");
2) ODBC
Install Tibero ODBC.
--ORACLE
DRIVER={Microsoft ODBC for Oracle}; server=(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=utf8)));UID=scott;PWD=tiger;
--TIBERO
DRIVER={Tibero 7 ODBC Driver};SERVER=127.0.0.1;PORT=8629
;DB=t7;UID=dbtech;PWD=dbtech;
3) OLE DB
--ORACLE Provider=msdaora;Data Source=MyDB;User Id=myUsername ;Password=myPassword; --TIBERO Provider=tbprov.Tbprov.6;Data Source=MyDB;User ID=dbtech;Password=dbtech ;Updatable Cursor=True;OLE DB Services=-2
2. Application Query Modification
Application query modification is only required when necessary, and is needed in the following situations.
1) When a Syntax Error Occurs - 1
| Situation | If you write SQL without giving an alias to a table or subquery in the FROM clause and perform a join, a syntax error occurs when there are duplicate columns. |
|---|---|
| Solution | Assign aliases to avoid duplication. |
2) When a Syntax Error Occurs - 2
| Situation | If you use a query like UNION ALL and the upper query uses a column as number type while the lower query uses it as varchar type, a syntax error occurs. |
|---|---|
| Solution | Use the same type for the same column in all clauses. |
3) When a Syntax Error Occurs - 3
| Situation | A syntax error occurs if you declare variables with the same name inside PSM (=PL/SQL). |
|---|---|
| Solution | Use the name of the last declared variable and delete the previously declared variables with the same name. |
4) When Results Are Not Output in Sorted Order
| Situation | In Oracle, results may appear sorted even without an ORDER BY clause, but in Tibero, results may not be sorted unless explicitly specified. |
|---|---|
| Solution | If you need sorted results, specify ORDER BY. |
5) When an Error Occurs During Compilation After Writing PSM (=PL/SQL)
| Situation | When compiling PSM (=PL/SQL), Tibero checks whether the objects and columns referenced in internal SQL actually exist, and raises an error if they do not. In contrast, Oracle may successfully compile in such cases, but a runtime error will occur instead. |
|---|---|
| Solution | Use objects that actually exist and use the correct column names. |