Description
OBridge is a Java source code generator for calling Oracle PL/SQL procedures and functions. It supports PL/SQL object types too.
OBridge alternatives and similar libraries
Based on the "Database" category.
Alternatively, view OBridge alternatives based on common mentions on social networks and blogs.
-
MapDB
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine. -
orientdb
OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries. -
ObjectBox embedded database
Android Database - first and fast, lightweight on-device vector database -
Crate
CrateDB is a distributed and scalable SQL database for storing and analyzing massive amounts of data in near real-time, even with complex queries. It is PostgreSQL-compatible, and based on Lucene. -
Chronicle Map
Replicate your Key Value Store across your network, with consistency, persistance and performance. -
JDBI
The Jdbi library provides convenient, idiomatic access to relational databases in Java and other JVM technologies such as Kotlin, Clojure or Scala. -
sql2o
sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters. -
JetBrains Xodus
Transactional schema-less embedded database used by JetBrains YouTrack and JetBrains Hub. -
FlexyPool
FlexyPool adds metrics and failover strategies to a given Connection Pool, allowing it to resize on demand.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of OBridge or a related project?
README
OBridge
OBridge provides a simple Java source code generator for calling Oracle PL/SQL package procedures.
Supported input, output parameters and return values are:
- BINARY_INTEGER
- BOOLEAN
- CHAR
- CLOB
- BLOB
- DATE
- NCHAR
- NUMBER
- NVARCHAR2
- OBJECT - Oracle Object Type
- PLS_INTEGER
- TABLE - Table of Oracle Object Type
- TIMESTAMP
- VARCHAR2
- RAW
The following types cannot be implemented, because JDBC driver does not supports them:
- Types declared in source code
- %ROWTYPE parameters
Generated code compiles with Java 1.6.
Usage
Download the latest version from releases.
After downloading, create an XML configuration file:
<configuration>
<jdbcUrl>jdbc:oracle:thin:scott/tiger@localhost:1521:xe</jdbcUrl> <!-- jdbc connection string for obridge -->
<sourceOwner>SCOTT</sourceOwner> <!-- owner of the database objects -->
<sourceRoot>.</sourceRoot> <!-- where to generate sources - related to this configuration file -->
<rootPackageName>hu.obridge.test</rootPackageName> <!-- root Java package, generator builds the directory structure -->
<packages>
<entityObjects>objects</entityObjects> <!-- object types are going to this package -->
<converterObjects>converters</converterObjects> <!-- converter util classes are going to this package -->
<procedureContextObjects>context</procedureContextObjects> <!-- procedure parameter entities are going to this package -->
<packageObjects>packages</packageObjects> <!-- procedure calling utility classes are going to this package -->
</packages>
</configuration>
Run the generator:
java -jar obridge.jar -c <obridge-config.xml>
OBridge connects to the specified database and generates the required classes.
Calling a PL/SQL procedure
For example you have the following PL/SQL code:
Create Or Replace Package simple_procedures is
Function simple_func(a In Varchar2,
b In Out Varchar2,
c Out Varchar2) Return Number;
End simple_procedures;
Generated source:
public class SimpleProcedures {
public static SimpleProceduresSimpleFunc simpleFunc(String a, String b, Connection connection) throws SQLException { ... }
}
You can call the SimpleProcedures.simpleFunc method:
SimpleProceduresSimpleFunc ret = SimpleProcedures.simpleFunc("hello", "world", conn); // conn is the database connection
Return object will hold the input and output parameters, converted to Java types.
public class SimpleProceduresSimpleFunc {
private BigDecimal functionReturn;
private String a;
private String b;
private String c;
// getters, setters
}