Are you using an in memory database? They don't persist so will be blank
each time you open it.
On 3/12/2013 11:29 AM, ??? wrote:
Do not know why......
11:17:41,719 INFO ~ Connected to
jdbc:h2:tcp://10.1.1.222/~/test;CACHE_SIZE=131
072;CACHE_TYPE=SOFT_LRU;WRITE_DELAY=2000
11:17:41,747 INFO ~ GAE environment detected
11:17:41,749 INFO ~ Siena DB Type: sql:h2:mysql
11:17:42,131 INFO ~ Table FT_INDEXES needs to be removed
11:17:42,137 INFO ~ Table IGNORELIST needs to be removed
11:17:42,137 INFO ~ Table MAP needs to be removed
11:17:42,137 INFO ~ Table ROWS needs to be removed
11:17:42,137 INFO ~ Table TEST needs to be removed
11:17:42,138 INFO ~ Table WORDS needs to be removed
11:17:42,168 INFO ~ Executed 6 SQL command(s) with 0 error(s)
11:17:42,197 INFO ~ Application 'Yi' is now started !
msg: select * from test where id = '1'
Exception: Table "TEST" not found; SQL statement:
select * from test where id = '1' [42102-166]
application.conf
# Database configuration
db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:fs:play"
db.default.url="jdbc:h2:mem:play"
db.url=jdbc:h2:tcp://10.1.1.222/~/test;
db.driver=org.h2.Driver
#db.driver=com.mysql.jdbc.Driver
db.user=sa
db.pass=
#source code
package controllers;
import play.*;
import play.mvc.*;
import java.sql.Connection;
//import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
import play.db.DB;
//@With(Secure.class)
public class Application extends Controller {
//@Check("User")
public static void index() throws ClassNotFoundException {
System.out.println("start");
String SQLString;
Connection Con = DB.getConnection();
SQLString = "select *";
SQLString += " from test";
SQLString += " where id = '" + "1'" ;
//SQLString = "SHOW TABLES;";
System.out.println("msg: " + SQLString);
try{
Statement Stmt = Con.createStatement();
if(Stmt == null) {
System.out.println("Stmt is null");
}
ResultSet Result = Stmt.executeQuery(SQLString);
if(Result == null) {
System.out.println("Res is null");
}
Result.next();
System.out.println(Result.getString("ID"));
if(Con != null) {
Con.close();
} else {
System.out.println("Con is null");
}
}catch(Exception e) {
System.out.println("Exception: " + e.getMessage());
}
render();
}
public static void index1(String name,String hidden) {
render(name,hidden);
}
}
Who can help me????A connection will remove database??
--
You received this message because you are subscribed to the Google
Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.