* desired. This allows additional functionality without losing any previous work or requiring any
* complicated inheritance dependencies.
*/
protected PyCursor cursor() {
PyCursor cursor = this.connection.cursor(true);
DataHandler origDataHandler = cursor.getDataHandler(), newDataHandler = null;
if ((origDataHandler != null) && (this.dataHandler != null)) {
Constructor cons = null;
try {
Class[] args = new Class[1];
args[0] = DataHandler.class;
cons = this.dataHandler.getConstructor(args);
} catch (Exception e) {
return cursor;
}
if (cons == null) {
String msg = zxJDBC.getString("invalidCons", new Object[]{this.dataHandler.getName()});
throw zxJDBC.makeException(msg);
}
try {
Object[] args = new Object[1];
args[0] = origDataHandler;
newDataHandler = (DataHandler) cons.newInstance(args);
} catch (Exception e) {
return cursor;
}
if (newDataHandler != null) {
cursor.__setattr__("datahandler", Py.java2py(newDataHandler));
}
}
return cursor;
}