A
Andrej Litowka
Hi All!
I have a LinkedHashMap, that I fill with this function:
public HashMap setCallPropertyValue(int Index, String Parameter, String
Type, String Value) {
LinkedHashMap tMap = new LinkedHashMap();
int index = 0;
int posBegin = 0,
posEnd = 0;
tMap.put("index", new Integer(Index) );
tMap.put("parameter", Parameter.toUpperCase() );
tMap.put("type", Type.toUpperCase() );
tMap.put("value", Value);
return tMap;
}
Then I put this Map in another map:
public void setCallProperties(Object key, Object val) {
propMap.put(key, val);
}
Where private Map propMap = Collections.synchronizedMap(new
LinkedHashMap());
And a call in main looks like this:
setCallProperties("res", setCallPropertyValue(1,"OUT","NVARCHAR2", null) );
When I then try to read a value from the map:
Iterator it = propMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry)it.next();
LinkedHashMap tMap = new LinkedHashMap();
tMap = (LinkedHashMap)entry.getValue();
String str = (String)tMap.get("type");
I get an error:
java.lang.NullPointerException
at
de.impulsus.util.ISU.CDBConnection.callDBStoredProcedureOrFunction(CDBConnec
tion.java:494)
at de.impulsus.app.TestISU.main(TestISU.java:28)
Exception in thread "main"
And in debuger str has a value:
"String" <error(s)_during_the_evaluation>
String cannot be resolved
I don't undertsand why. Has anybody any idea?
Any help will be appreciate.
Regards,
Andrej.
I have a LinkedHashMap, that I fill with this function:
public HashMap setCallPropertyValue(int Index, String Parameter, String
Type, String Value) {
LinkedHashMap tMap = new LinkedHashMap();
int index = 0;
int posBegin = 0,
posEnd = 0;
tMap.put("index", new Integer(Index) );
tMap.put("parameter", Parameter.toUpperCase() );
tMap.put("type", Type.toUpperCase() );
tMap.put("value", Value);
return tMap;
}
Then I put this Map in another map:
public void setCallProperties(Object key, Object val) {
propMap.put(key, val);
}
Where private Map propMap = Collections.synchronizedMap(new
LinkedHashMap());
And a call in main looks like this:
setCallProperties("res", setCallPropertyValue(1,"OUT","NVARCHAR2", null) );
When I then try to read a value from the map:
Iterator it = propMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry)it.next();
LinkedHashMap tMap = new LinkedHashMap();
tMap = (LinkedHashMap)entry.getValue();
String str = (String)tMap.get("type");
I get an error:
java.lang.NullPointerException
at
de.impulsus.util.ISU.CDBConnection.callDBStoredProcedureOrFunction(CDBConnec
tion.java:494)
at de.impulsus.app.TestISU.main(TestISU.java:28)
Exception in thread "main"
And in debuger str has a value:
"String" <error(s)_during_the_evaluation>
String cannot be resolved
I don't undertsand why. Has anybody any idea?
Any help will be appreciate.
Regards,
Andrej.