Articulo escrito

  • on 19.03.2009
  • a las 04:00 PM
  • por rhypee

Llamar a una función PL/SQL desde java 0

Mar19

1: //Recibe como parámetro un String y retorna un String

2:

3: private String ExtraerFuncion(String usercode) throws SQLException, Exception, Error{

4:

5: String sql = “”, dato=”";

6: sql = “{? = call FN_RETURN_FUNCION(?)}”;

7: CallableStatement cs = null;

8:

9: try

10: {

11: cs = sessionManager.getConnection().prepareCall(sql);

12: cs.registerOutParameter(1, Types.VARCHAR);

13: cs.setString(2, usercode);

14: cs.execute();

15: dato = cs.getString(1);

16: }

17: catch (Exception e)

18: {

19: e.printStackTrace();

20: }

21: finally

22: {

23: cs.close();

24: }

25: return dato;

26: }

Si te gusto, comparteme These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • BarraPunto
  • Facebook
  • Google Bookmarks
  • Meneame
  • Technorati
  • TwitThis
  • Wikio ES

subscribe to comments RSS

Este post no no tiene aun comentarios

Escribe un comentario, es gratuito

* these are required fields

rhypee 2.0 is powered by WordPress and FREEmium Theme.
developed by Dariusz Siedlecki and brought to you by FreebiesDock.com