Home » Archive

Articles tagged with: java database

Oracle Error Codes »

[3 May 2009 | No Comment | 166 views]

ORACLE ERROR CODE ORA-00021
ERROR
session attached to some other process; cannot switch session
CAUSE
The user session is currently used by others
ACTION
Do not switch to a session attached to some other process

Oracle Error Codes »

[3 May 2009 | No Comment | 202 views]

ORACLE ERROR CODE ORA-00020
ERROR
maximum number of processes (string) exceeded
CAUSE
All process state objects are in use
ACTION
Increase the value of the PROCESSES initialization parameter

Oracle Error Codes »

[3 May 2009 | No Comment | 153 views]

ORACLE ERROR CODE ORA-00019
ERROR
maximum number of session licenses exceeded
CAUSE
All licenses are in use
ACTION
Increase the value of the LICENSE MAX SESSIONS initialization parameter

Oracle Error Codes »

[3 May 2009 | No Comment | 171 views]

ORACLE ERROR CODE ORA-00018
ERROR
maximum number of sessions exceeded
CAUSE
All session state objects are in use
ACTION
Increase the value of the SESSIONS initialization parameter

Oracle Error Codes »

[3 May 2009 | No Comment | 101 views]

ORACLE ERROR CODE ORA-00017
ERROR
session requested to set trace event
CAUSE
The current session was requested to set a trace event by another session
ACTION
This is used internally; no action is required

Java Codes »

[23 Feb 2009 | No Comment | 54 views]

This example shows how to connect to a database, in this case a MS SQL Server database
and read rows from a table.
It is assumed that the table has 3 columns and they all contains string-values (datatype char, varchar etc.).
To connect to another database type, just change the driver and url to match the specific type.
Note that you’ll have to change some of the values to match your own environment(database, table, userid and password),
and to make it work, you will have to download the jdbc driver from Microsoft and put it …

Java Codes »

[23 Feb 2009 | No Comment | 85 views]

This example demonstrates how to use a transaction with JDBC.
The only thing really that differs from ordinary database operations is that you set a boolean value on the Connection object.
The Connection object has a method called setAutoCommit which sets a value of the object that decides whether to execute the query immediately or not.
Default that value is true, so in order to utilize a transaction you need to set it to false. In the example a new connection is created and finally also closed.
It is though more common to have …

Java Codes »

[23 Feb 2009 | No Comment | 150 views]

This code example shows how to connect to a database (in this case MS SQL Server) and call a stored procedure.
To call the stored procedure you create an instance of the class CallableStatement by calling the method prepareCall() on the Connection object.
In the first example below we assume that the name of the stored procedure is “generateID” and it takes one string argument, and returns an Id which depends on the argument (in the example it returns employeeId).
The value of the argument is set by calling the method setString() on …