Procedure Oracle call

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Procedure Oracle call

Efisio Manca
It's possible call  Procedure Oracle call with  input Custom type Oracle .
I mapped parameter 
....
#{chiaveProvv, javaType=it.generali.gfv.p2l.db.model.ChiaveProvvigionale , jdbcType=STRUCT, jdbcTypeName=GFV.TYPE_TEST_1 , mode=IN, typeHandler=it.generali.gfv.p2l.db.customhandler.ChiaveProvvigionaleHandler}
...

and create custom handler  for set param :

 public void setParameter(PreparedStatement ps, int i , Object parameter,
JdbcType jdbcType) throws SQLException {
// TODO Stub di metodo generato automaticamente
StructDescriptor structDescriptor = StructDescriptor.createDescriptor("GFV.TYPE_TEST_1", WSCallHelper.getNativeConnection(ps.getConnection()));
.....
STRUCT struct = new STRUCT(structDescriptor, WSCallHelper.getNativeConnection(ps.getConnection()), params);
          ps.setObject(i, struct ,  Types.STRUCT);
}

 but MyBatis not bind the param in input :

### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in it/generali/gfv/p2l/db/mapper/ListaChiaveProvvigionaleP2lMapper.xml
### The error may involve it.generali.gfv.p2l.db.mapper.ListaChiaveProvvigionaleP2lMapper.invokePlSql-Inline
### The error occurred while setting parameters
### SQL: {CALL  GFV.GFV_P2L_SOA_SERVICES.TEST_FARLOCCO(     ?     )
### Cause: java.lang.NullPointerException
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)

Thanks  a lot.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Procedure Oracle call

Guy Rouillier-2
Did you debug this to verify that the statement you show below results in a non-null STRUCT?

--
Guy Rouillier



------ Original Message ------
From: "Efisio Manca" <[hidden email]>
To: "mybatis-user" <[hidden email]>
Sent: 3/1/2017 9:56:22 AM
Subject: Procedure Oracle call

It's possible call  Procedure Oracle call with  input Custom type Oracle .
I mapped parameter 
....
#{chiaveProvv, javaType=it.generali.gfv.p2l.db.model.ChiaveProvvigionale , jdbcType=STRUCT, jdbcTypeName=GFV.TYPE_TEST_1 , mode=IN, typeHandler=it.generali.gfv.p2l.db.customhandler.ChiaveProvvigionaleHandler}
...

and create custom handler  for set param :

 public void setParameter(PreparedStatement ps, int i , Object parameter,
JdbcType jdbcType) throws SQLException {
// TODO Stub di metodo generato automaticamente
StructDescriptor structDescriptor = StructDescriptor.createDescriptor("GFV.TYPE_TEST_1", WSCallHelper.getNativeConnection(ps.getConnection()));
.....
STRUCT struct = new STRUCT(structDescriptor, WSCallHelper.getNativeConnection(ps.getConnection()), params);
          ps.setObject(i, struct ,  Types.STRUCT);
}

 but MyBatis not bind the param in input :

### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in it/generali/gfv/p2l/db/mapper/ListaChiaveProvvigionaleP2lMapper.xml
### The error may involve it.generali.gfv.p2l.db.mapper.ListaChiaveProvvigionaleP2lMapper.invokePlSql-Inline
### The error occurred while setting parameters
### SQL: {CALL  GFV.GFV_P2L_SOA_SERVICES.TEST_FARLOCCO(     ?     )
### Cause: java.lang.NullPointerException
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)

Thanks  a lot.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

Virus-free. www.avast.com

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Procedure Oracle call

Efisio Manca
Hi , Yes in this point 
    ps.setObject(i, struct ,  Types.STRUCT);

struct is not null , or better  property datum is not null  but Data property is null 

Immagine incorporata 2
thank you.



2017-03-02 3:28 GMT+01:00 Guy Rouillier <[hidden email]>:
Did you debug this to verify that the statement you show below results in a non-null STRUCT?

--
Guy Rouillier



------ Original Message ------
From: "Efisio Manca" <[hidden email]>
To: "mybatis-user" <[hidden email]>
Sent: 3/1/2017 9:56:22 AM
Subject: Procedure Oracle call

It's possible call  Procedure Oracle call with  input Custom type Oracle .
I mapped parameter 
....
#{chiaveProvv, javaType=it.generali.gfv.p2l.db.model.ChiaveProvvigionale , jdbcType=STRUCT, jdbcTypeName=GFV.TYPE_TEST_1 , mode=IN, typeHandler=it.generali.gfv.p2l.db.customhandler.ChiaveProvvigionaleHandler}
...

and create custom handler  for set param :

 public void setParameter(PreparedStatement ps, int i , Object parameter,
JdbcType jdbcType) throws SQLException {
// TODO Stub di metodo generato automaticamente
StructDescriptor structDescriptor = StructDescriptor.createDescriptor("GFV.TYPE_TEST_1", WSCallHelper.getNativeConnection(ps.getConnection()));
.....
STRUCT struct = new STRUCT(structDescriptor, WSCallHelper.getNativeConnection(ps.getConnection()), params);
          ps.setObject(i, struct ,  Types.STRUCT);
}

 but MyBatis not bind the param in input :

### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in it/generali/gfv/p2l/db/mapper/ListaChiaveProvvigionaleP2lMapper.xml
### The error may involve it.generali.gfv.p2l.db.mapper.ListaChiaveProvvigionaleP2lMapper.invokePlSql-Inline
### The error occurred while setting parameters
### SQL: {CALL  GFV.GFV_P2L_SOA_SERVICES.TEST_FARLOCCO(     ?     )
### Cause: java.lang.NullPointerException
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)

Thanks  a lot.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

Virus-free. www.avast.com

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/HeO7P_m3Lso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re[2]: Procedure Oracle call

Guy Rouillier-2
Looks like that structure has been initialized - memset 0 - but not populated.  Expand m_datumArray and m_descriptor and see if either has any content.  The fact that data is null reinforces this observation.

--
Guy Rouillier



------ Original Message ------
From: "Efisio Manca" <[hidden email]>
Sent: 3/2/2017 4:40:53 AM
Subject: Re: Procedure Oracle call

Hi , Yes in this point 
    ps.setObject(i, struct ,  Types.STRUCT);

struct is not null , or better  property datum is not null  but Data property is null 

Immagine incorporata 2
thank you.



2017-03-02 3:28 GMT+01:00 Guy Rouillier <[hidden email]>:
Did you debug this to verify that the statement you show below results in a non-null STRUCT?

--
Guy Rouillier



------ Original Message ------
From: "Efisio Manca" <[hidden email]>
To: "mybatis-user" <[hidden email]>
Sent: 3/1/2017 9:56:22 AM
Subject: Procedure Oracle call

It's possible call  Procedure Oracle call with  input Custom type Oracle .
I mapped parameter 
....
#{chiaveProvv, javaType=it.generali.gfv.p2l.db.model.ChiaveProvvigionale , jdbcType=STRUCT, jdbcTypeName=GFV.TYPE_TEST_1 , mode=IN, typeHandler=it.generali.gfv.p2l.db.customhandler.ChiaveProvvigionaleHandler}
...

and create custom handler  for set param :

 public void setParameter(PreparedStatement ps, int i , Object parameter,
JdbcType jdbcType) throws SQLException {
// TODO Stub di metodo generato automaticamente
StructDescriptor structDescriptor = StructDescriptor.createDescriptor("GFV.TYPE_TEST_1", WSCallHelper.getNativeConnection(ps.getConnection()));
.....
STRUCT struct = new STRUCT(structDescriptor, WSCallHelper.getNativeConnection(ps.getConnection()), params);
          ps.setObject(i, struct ,  Types.STRUCT);
}

 but MyBatis not bind the param in input :

### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in it/generali/gfv/p2l/db/mapper/ListaChiaveProvvigionaleP2lMapper.xml
### The error may involve it.generali.gfv.p2l.db.mapper.ListaChiaveProvvigionaleP2lMapper.invokePlSql-Inline
### The error occurred while setting parameters
### SQL: {CALL  GFV.GFV_P2L_SOA_SERVICES.TEST_FARLOCCO(     ?     )
### Cause: java.lang.NullPointerException
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)

Thanks  a lot.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

Virus-free. www.avast.com

--
You received this message because you are subscribed to a topic in the Google Groups "mybatis-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mybatis-user/HeO7P_m3Lso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

Virus-free. www.avast.com

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...