Results 1 to 2 of 2
  1. #1
    vitaly87 is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    0

    Default convert resultSet to Instances

    Hello all!
    I dont know how can i convert resultSet to Instances in java.
    I want to use the Weka(data mining) to run on my db.
    the code that i have is:
    Java Code:
     connect = DriverManager.getConnection("jdbc:derby:C:/Documents and Settings/vitaly/.netbeans-derby/simple", "demo", "demo");
            statement = connect.createStatement();
            resultSet = statement.executeQuery("SELECT * FROM DEMO.info");
    I am using netbeans.
    I need to get the code that can do this:
    Instances data=(Instances)resultSet

    I tried to write this :

    Java Code:
          Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
      //jdbcDriver=org.gjt.mm.mysql.Driver;
     
     
             InstanceQuery query = new InstanceQuery();
     query.setUsername("demo");
     query.setPassword("demo");
     query.setQuery("select * from DEMO.info");
     // if your data is sparse, then you can say so too
     // query.setSparseData(true);
     Instances data = query.retrieveInstances();
    but get erros
    Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
    thanks for helping

  2. #2
    demonick is offline Member
    Join Date
    Dec 2010
    Posts
    27
    Rep Power
    0

    Default

    Search on how to iterate ResultSet, I think this will solve the code part, also check if all .jar files needed are imported and added to classpath, and check location of DB.

Similar Threads

  1. Creating new instances of a Match over and over again
    By Che_Is_Alive in forum Advanced Java
    Replies: 2
    Last Post: 11-19-2009, 07:05 PM
  2. Problem with class instances
    By sdwinder in forum New To Java
    Replies: 7
    Last Post: 10-21-2009, 02:25 AM
  3. Build Instances problem
    By leapinlizard in forum New To Java
    Replies: 4
    Last Post: 04-21-2009, 11:17 AM
  4. Calling a method for all instances of an object
    By rattle in forum New To Java
    Replies: 4
    Last Post: 04-30-2008, 03:10 PM
  5. Naming object instances
    By oldgit in forum New To Java
    Replies: 9
    Last Post: 02-08-2008, 12:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •