# 22. Virtuoso Functions Guide - import_jar

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
import_jar
internal_to_sql_type
internal_type
internal_type_name
isarray
isbinary
isblob
isdouble
isentity
isfloat
isinteger
isnull
isnumeric
isstring
iszero
jvm_ref_import
make_string
sign
stringdate
stringtime
udt_defines_field
udt_get
udt_implements_metho...
udt_instance_of
udt_set
unimport_jar
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## import_jar

Creates SQL wrapper types of selected Java classes
void import_jar (in files any, in classes any, [in security_mode integer]);
Description

This function calls the jvm_ref_import() function to produce the XML, then transforms it to a set of CREATE TYPE statements and executes them. The SQL names of the types are generated by retrieving the fully qualified name of the Java class and substituting the . with _ (e.g.: java.lang.System becomes java_lang_System). The names of the static members observer functions are composed by prepending the name of the static member with 'get' so the static Java member stat_m is mapped to a SQL static method getstat_m(). As a result it creates SQL type wrappers for the specified Java classes.

Parameters
files – Null, string or vector of strings. This can contain one or many Java .class files, .zip or .jar files to pick classes from. Null means only the classes specified in the classes argument regardless of their physical location.
classes – Wildcard string or a vector of strings specifying which classes to describe in the resulting XML.
security_mode – This optional parameter defines the access mode as follows:

- 0 - restricted (default if unspecified)
- 1 - unrestricted

Examples

    SQL> import_jar (null, vector ('java.lang.System'));
    SQL> select java_lang_System::getProperty('java.vm.name');
    callret
    NVARCHAR
    _______________________________________________________________________________

    Java HotSpot(TM) Client VM

See Also

unimport_jar()

jvm_ref_import()