My Headlines
Showing posts with label Oracle Lite FAQ. Show all posts
Showing posts with label Oracle Lite FAQ. Show all posts
How compatible is Oracle Lite with the standard Oracle Server?
Although code compatibility is very high, the following features are not supported in Oracle Lite:- PL/SQL (use Java Stored Procedures and triggers instead)
- Oracle Lite is intended as a small, single-user client database and do not support any server functionalities like Java CORBA ORB's, SQL*Net Listeners, etc.
- In Oracle Lite, all rows are stored as objects, and there is a relational layer on top of the object layer to allow relational views of the data. Oracle7/8 stores data in a relational format, then uses an object metalayer to provide object views and functionality.
- Only selected dictionary views are available, eg. ALL_TABLES, ALL_VIEWS, ALL_USERS, CAT, etc.
- An Oracle Lite database can only be queried from a remote client if it's data is replicated.
What is Personal Oracle Lite?
Personal Oracle Lite (POL) is a lightweight, single-user object/relational database that runs on desktops, laptops, down to the smallest hand help devices. It is designed for mobile and distributed applications.Some of the main features are:
- POL runs in under 1 megabyte of memory, and can be installed in 3 megabytes of hard disk space;
- has full Java and SQL support (no PL/SQL);
- is ODBC and JDBC compliant;
- can handle up to 16 concurrent application connections;
- supports replication via file, HTTP, SQL*Net, and Oracle Mobile Agents;
- runs on WindowsNT, Windows95/98, WindowsCE, and PalmOS.
How does one connect to a POL database?
To connect to a POL database, the username is typically SYSTEM (with POL v2.4 the default username was OOT_SCH). The password is ignored as the POL database is initially not password protected, but must be specified for SQL*Plus. The connect string should be ODBC:data_source_name. The "ODBC:" tells SQL*Plus that this is not a SQL*Net connection, and that it must use the Oracle Open Client Adapter (OCA) to access the database.The following command line is used to access the default starter database via SQL*Plus (8i and below):
sqlplus system/manager@odbc:polite:polite SQL> select * from all_tables; SQL> exit;For Oracle 9i, use the Mobile SQL (msql) utility:
C:>msql system/manager@jdbc:polite:polite Oracle MSQL Version 1.0.0.0.2 (c) Copyright 2001 Oracle Corporation. All rights reserved Connected to: Oracle9i Lite ORDBMS Database Name: POLITE (Read Write) Database Version: 4.0.3.0.0 Auto Commit: off Driver Name: oracle.lite.poljdbc.POLJDBCDriver (OLite 4.0) SQL>
How does one write Java Stored Procedures?
Step 1: Create the Java Class and Methods in a fileIn this example we will create a Java class "EMPL" in a file called EMPL.java to implement the get_sal method:
import java.sql.*;
public class EMPL {
public static int get_sal(Connection conn, int empno) throws Exception
{
Statement s = conn.createStatement();
ResultSet r = s.executeQuery("SELECT sal, nvl(comm,0) FROM EMP WHERE empno="+empno);
int sal = 0;
if (r.next()) {
sal = r.getInt(1) + r.getInt(2); /* sal = :sal + :comm */
} else {
throw new Exception("Employee "+empno+" is invalid.");
}
r.close(); s.close();
System.out.println("Salary for employee "+empno+" is "+sal);
return sal;
}
}
Step 2: Attach the Java Class to the Table ALTER TABLE EMP ATTACH SOURCE "EMPL" IN '.';Step 3: Execute the Method
To execute the get_sal method from SQL*Plus:
SELECT EMP."get_sal"(7369) FROM DUAL;To execute this method from ODBC:
SQLExecDirect(hstm, "SELECT EMP."get_sal"(7369) FROM DUAL");
How does one replicate data using Oracle Lite?
Oracle Lite supports read-only and updatable snapshot replication.Any other Oracle Lite tips?
- Use the ODBC function to get the DB name: SELECT CAST({FN DATABASE()} AS CHAR(16)) FROM DUAL;
- To create a new database use the following command line: CREATEDB polite new_db_name
- Connect to your newly created DB with connect string: system/manager@odbc:polite:new_db_name
Subscribe to:
Posts (Atom)
Popular Posts
-
What is ENUM? ENUM is short for enumeration. Its a useful programming type that contains an ordered list of string values. The program...
-
A colleague asked me some questions about FIRST_ROWS and ALL_ROWS, but I'm hesitant to blog about it because it's already been done...
-
Dear Blog Readers, Every now and then I do receive e-mails from the novice DBAs saying that: “We could not perform well at the interview...
-
HowTo: Create a universal UDM report page in OEM PROBLEM: You have a bunch of User Defined Metrics (UDM) setup in OEM, and you want to kn...
-
Have you run the new Oracle 11g installer on *NIX and received a nasty message? It happened to me this week! So, let's say you downloa...
-
REM:********************************************************************************************** REM: Script : Max 50 I/O Informations R...
-
What is NOCOPY? 'NOCOPY' is an optional 'hint' to tell the PL/SQL 'compiler' not to go through the overhead of ma...
-
This blog post is for them; those who are desperately looking for free Oracle Certification dumps. Well, you might be surprised to see the...
-
I was browsing the Oracle Forums earlier today and this post with a bit of SQL to clear OEM alerts from mnazim , who always has good advice...
-
Having chosen Oracle SQL Developer as your preferred Oracle database tool, do you have to install and learn a new technology for supporting...