• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connecting java program to openoffice base

 
Jitto P.Jose
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using ubuntu feisty,
now am doing a small java program that connect to openoffice base.
the program i wrote is given below. while running i always got error as "java.sql.SQLException: Table not found in statement [select * from test]"
it didnt make any problem till the line of connection establishment. but at the time of executeQuery(), it produce exception
please help me if anybody know anything about this problem




the code is ..

import java.sql.*;


public class TestDb {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("hai");


try {
Class.forName("org.hsqldb.jdbcDriver");
}
catch(ClassNotFoundException e) {
System.out.println(e);
}

try {
Connection con=null;
try{
con=DriverManager.getConnection("jdbc:hsqldb:jitto db");
}catch(Exception e){
System.out.println(e.getMessage());
}
System.out.println(con.toString());
Statement st=con.createStatement();
System.out.println(st.toString());
String s="create table test (name varchar(20))";
//String s="insert into login values('jitto')";
ResultSet rs=st.executeQuery("select * from test");
//st.executeQuery(s);

st.close();
con.close();

}
catch(SQLException e){
System.out.println(e);
}


}

}





error found:--

"java.sql.SQLException: Table not found in statement [select * from test]"



thanks
jittos....
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know for sure whether that table exists?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic