Home > database >  Oracle USES Java stored procedures problem: Angle brackets
Oracle USES Java stored procedures problem: Angle brackets

Time:10-05

Environment is in a small machine (aix) on the database of Oracle 11 g, other environments Linux, Windows are not this error,
Written in a running Java stored procedure, prompt the error


In the delete ArrayList List=null; After this code, can be run,
So the problem & lt; "" Angle brackets, I don't know what the reason, why will result in Angle brackets will quote this wrong, do not know to have friend met, there is a solution?

CodePudding user response:

The string s to lower case

CodePudding user response:

reference 1st floor shoppo0505 response:
string s to lower case.

String type is, how can lower case

CodePudding user response:

Before contact with oracle using Java, not to the array, send some simplified code, convenient I debugged;

CodePudding user response:

reference wmxcn2000 reply: 3/f
before contact with oracle using Java, not to the array, send some simplified code, convenient I debugged;

 create or replace the and compile the Java source named indicator as 
Package com. Wonders. SJZL;
Import the Java. SQL. Connection;
Import of Java, SQL PreparedStatement;
Import the Java. SQL. The ResultSet;
Import the Java. Text. SimpleDateFormat;
Import the Java. Util. ArrayList;
Public class Indicator {
Public final static String FAILURE="E";
Public final static String CONNERR="C";
Public final static SimpleDateFormat SDF=new SimpleDateFormat (" yyyyMMdd ");
Public final static String [] list (Connection Connection, String indicator_type, String indicator_code) throws the Exception {
returnValue=https://bbs.csdn.net/topics/null; String []
StringBuffer SQL=null;
The ResultSet ResultSet=null;
PreparedStatement PreparedStatement=null;
ArrayList List=null;
Try {
SQL=new StringBuffer (32);
SQL. Append (" SELECT * FROM TB_INDICATOR WHERE INDICATOR_TYPE=?" );
If (indicator_code!=null& !" ". The equals (indicator_code)) {
SQL. Append (" AND INDICATOR_CODE=?" );
}
List=new ArrayList (8);
PreparedStatement=connection. PrepareStatement (SQL. The toString ());
PreparedStatement. SetString (1, indicator_type);
If (indicator_code!=null& !" ". The equals (indicator_code)) {
PreparedStatement. SetString (2, indicator_code);
}
The resultSet=preparedStatement. ExecuteQuery ();
While (resultSet. Next ()) {
INDICATOR_CODE list. Add (resultSet. Get string (" "));
}
if(! List. IsEmpty ()) {
returnValue=https://bbs.csdn.net/topics/list.toArray (new String [list. The size () ");
}
} the finally {
If (resultSet!=null) {
Try {
The resultSet. Close ();
{} the catch (Exception ne)
}
The resultSet=null;
}
If (preparedStatement!=null) {
Try {
PreparedStatement. Close ();
{} the catch (Exception ne)
}
PreparedStatement=null;
}
}
Return the returnValue.
}
}

CodePudding user response:

reference 4 floor mdfxyy1234 response:
Quote: reference wmxcn2000 reply: 3/f

Before contact with oracle using Java, not to the array, send some simplified code, convenient I debugged;

 create or replace the and compile the Java source named indicator as 
Package com. Wonders. SJZL;
Import the Java. SQL. Connection;
Import of Java, SQL PreparedStatement;
Import the Java. SQL. The ResultSet;
Import the Java. Text. SimpleDateFormat;
Import the Java. Util. ArrayList;
Public class Indicator {
Public final static String FAILURE="E";
Public final static String CONNERR="C";
Public final static SimpleDateFormat SDF=new SimpleDateFormat (" yyyyMMdd ");
Public final static String [] list (Connection Connection, String indicator_type, String indicator_code) throws the Exception {
returnValue=https://bbs.csdn.net/topics/null; String []
StringBuffer SQL=null;
The ResultSet ResultSet=null;
PreparedStatement PreparedStatement=null;
ArrayList List=null;
Try {
SQL=new StringBuffer (32);
SQL. Append (" SELECT * FROM TB_INDICATOR WHERE INDICATOR_TYPE=?" );
If (indicator_code!=null& !" ". The equals (indicator_code)) {
SQL. Append (" AND INDICATOR_CODE=?" );
}
List=new ArrayList (8);
PreparedStatement=connection. PrepareStatement (SQL. The toString ());
PreparedStatement. SetString (1, indicator_type);
If (indicator_code!=null& !" ". The equals (indicator_code)) {
PreparedStatement. SetString (2, indicator_code);
}
The resultSet=preparedStatement. ExecuteQuery ();
While (resultSet. Next ()) {
INDICATOR_CODE list. Add (resultSet. Get string (" "));
}
if(! List. IsEmpty ()) {
returnValue=https://bbs.csdn.net/topics/list.toArray (new String [list. The size () ");
}
} the finally {
If (resultSet!=null) {
Try {
The resultSet. Close ();
{} the catch (Exception ne)
}
The resultSet=null;
}
If (preparedStatement!=null) {
Try {
PreparedStatement. Close ();
{} the catch (Exception ne)
}
PreparedStatement=null;
}
}
Return the returnValue.
}
}

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related