S
Sharp Tool
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/
In the main file, the query.parse() appears to have trouble finding
the person class. Can anyone shed some light on this?
/* 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
I'm trying to learn how to use a new tool called JoSQL available at the
Source Forge project. Link: http://josql.sourceforge.net/
In the main file, the query.parse() appears to have trouble finding
the person class. Can anyone shed some light on this?
/* 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