• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I have class name,method name,input parameter datatypes as Strings.How to invoke the desired method?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please reply
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Narik and welcome to JavaRanch!

Unfortunately your problem description is not detailed enough for anyone here to know what you are trying to achieve. As you posted the question to the 'Distribued Java' forum I guess you want to make some kind of remote procedure call, right? There are many existing solutions and frameworks for this like Web Services, RMI, EJB and many more. But without knowing more about your problem it's impossible to give you good advices. You should try to explain it in a little bit more detail.

Marco
 
Narik Ramuk
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry.


What I am trying to achieve is.

I have a table in database having Class name , Method Name, Parameters the method takes and datatypes of the parameters.

I have to call that particular method by passing the parameters and get the return value dynamically in my class.

I hope this info is sufficient to understand what I want.


Is there a possible way?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So this all happens within the same JVM? As Marco said, "distributed" usually implies that more than one JVM is involved.
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If all you want to do is to call methods dynamically based on class and method names then the Reflection API is your friend. But this has nothing to do with distributed Java.

Marco
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic