JavaSQL



Hi,

I'm trying to learn how to use a new tool called JoSQL available at the
Source Forge project.
Link: http://josql.sourceforge.net/
See below:

/* PERSON CLASS*/

package classfiles;

public class Person{
String name;

public Person (String name){
this.name = name;
}

public String toString(){
return name;
}
}

/* JAVASQL CLASS - MAIN FILE */
package classfiles;

import java.util.*;
import org.josql.*;

public class JavaSQL
{
public static void main (String[] args){
JavaSQL jSQL = new JavaSQL();
jSQL.start();
}

public void start(){
Person p1 = new Person ("foo");
Person p2 = new Person ("bar");
List list = new ArrayList();
list.add(p1);
list.add(p2);

try{
Query query = new Query();
query.parse("SELECT * FROM classfiles.Person ORDER BY name"); //ERROR
APPEARS TO BE HERE!
QueryResults rs = query.execute(list);
for(Iterator i = rs.getResults().iterator(); i.hasNext();){
Person p = (Person)i.next();
System.out.println(p);
}
}
catch(Exception e){
e.printStackTrace();
}
}
}

/*Run-time error message */
org.josql.QueryParseException: Unable to load FROM class: classfiles.Person
at org.josql.Query.parse(Query.java:1783)
at classfiles.JavaSQL.start(JavaSQL.java:25)
at classfiles.JavaSQL.main(JavaSQL.java:11)
Caused by: java.lang.ClassNotFoundException: classfiles.Person
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.josql.Query.parse(Query.java:1779)
... 2 more
Press any key to continue...


Any help appreciated.
Sharp


.



Relevant Pages

  • Re: XmlSerializer Collection with Collections
    ... > - a bunch of Option objects are contained within an OptionList ... > It is the extra level of object containment in the original version that ... >> public class TestSerializer ... >> public Question(string QuestionText, string Type, int Score, bool ...
    (microsoft.public.dotnet.xml)
  • Re: How to OPEN native PRINTER DIALOG -- Please HELP !!
    ... > function IsNetworkPrinter(PrinterName as string) as boolean ... Public Class YourPrintDialog ... Dim infos As New ArrayList ... ByRef cchBuffer As Int32) As Int32 ...
    (microsoft.public.dotnet.languages.vb)
  • Re: constructors/static methods and inheritance query
    ... public class BaseLine: IBaseLine { ... public static BaseLine Initialize(string x1, string y1, string ... public int keyLength; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Error : Complex DataBinding accepts as a data source either an IList or an IListSource
    ... > Public Class responseHistoricalData ... > Public equipmentID As String ... > Public proximity() As proximity ... > Private _serviceMeterHours As String ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: XmlSerializer Collection with Collections
    ... What you can do here is hide the OptionList from serialization as follows: ... > public class TestSerializer ... > public int AddQuestion(Question question) ... > public Question(string QuestionText, string Type, int Score, bool ...
    (microsoft.public.dotnet.xml)