Monday, November 24, 2014

SOA 12c Creating Derby Database Connection

Introduction:
JavaDB (Derby) is used to run SOA Suite repository on that is used for the integrated server. It is a development database that allows one to start development with SOA Suite without the need to run RCU.


How to create connection:
The steps are quite simple.

1) You need to Open Database Navigator, as shown below




2) Create a new connection

3) Choose Java DB (Derby) from Connection Type drop down and give connection Name


4) Automatically all details will be filled up, but you need to choose the Library. Click on the glass search window and choose Java DB JDBC Driver. Click Ok



5) Test the connection


6) Now you can see the connection in Jdeveloper. Its good to go now





1 comment:

Unknown said...

package derbytest;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class DerbyTest {
public DerbyTest() {
try {
Class.forName("org.apache.derby.jdbc.ClientDriver");
} catch (ClassNotFoundException cnfe) {
System.err.println("Derby driver not found.");
}
try {
Connection conn = DriverManager.getConnection("jdbc:derby://localhost/test;create=true;user=APP;pass=APP");
Statement s = conn.createStatement();
s.execute("CREATE TABLE test (id integer primary key not null, text varchar(32))");
s.execute("INSERT INTO test VALUES (1, 'hello world!')");
s.execute("SELECT \* FROM test");
ResultSet rs = s.getResultSet();
while (rs.next()) {
System.out.println("Derby says: "+rs.getString("text"));
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
public static void main(String[] args) {
new DerbyTest();
}
}For information related to human life, please visit this blog.
<a href="https://internationalyouthacuity.blogspot.com/