views:

32

answers:

1

Hi all,

I have return a web services which return "Instances" from a datamining api. Now the problem is obvious web services by default cannot handle "Instances" as return type. What should be my approach.

Or

I may have to say User defined data types, please guide me of any documentation where I can implement this.

//////////////////////////////////////////////////////// 


    public Instances fetch(){ 

      Properties properties =
              Utils.readProperties("weka/experiment/DatabaseUtils.props"); 
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); 
      String url = "jdbc:oracle:thin:@localhost:1521:XE"; 
      java.util.Properties props = new java.util.Properties(); 
          props.setProperty("user", "system"); 
          props.setProperty("password", "root") 

           DriverManager.registerDriver(new OracleDriver()); 
           Connection conn = DriverManager.getConnection(url, props); 

          Statement stmt = conn.createStatement(); 


        ResultSet rset1 = stmt.executeQuery("SELECT * FROM iris""); 
         return retrieveInstances(rset1); 
} 

//////////////////////////////////////////////////////// 

thanks in advance SR

A: 

Well, I think you should focus on data, rather than Instances. Try to serialize to XML or use JSON to pass data across.

Moreover, there are plenty of answers posted on this site:

http://stackoverflow.com/search?q=web+service+complex+data

Hope that helps,

Ramon Araujo