I have rattled my brain on this now for a few days. i have searched hi and low, and cant find an example on creating a server for the Data base HSQLdb,
there is the code that i am using, the problem is it always returns as the discriptor "shutdown" and i dont know what i am doing wrong,
thus NO client can connect to it,
public void setUp ()
{
try
{
Class.forName ("org.hsqldb.jdbcDriver");
// Connection c = DriverManager.getConnection (urlr, user, password);
}
catch (Exception e)
{
e.printStackTrace ();
}
String db_name = "mydb";
String serverProps;
String url = "jdbc:hsqldb:file:mydb";
String user = "sa";
String password = "";
System.out.println ("network mode");
server = new Server ();
server.setRestartOnShutdown (true);
server.setDatabaseName (0, db_name);
server.setDatabasePath (0, url);
server.setLogWriter (null);
server.setErrWriter (null);
server.start ();
//server.setPort (5000);
//server.start();
System.out.println (server.getStateDescriptor ());
System.out.println (server.getAddress ());
String urlr = "jdbc:hsqldb:hsql://localhost:mydb";
try
{
Class.forName ("org.hsqldb.jdbcDriver");
Connection c = DriverManager.getConnection (urlr, user, password);
}
catch (Exception e)
{
e.printStackTrace ();
}
}
can any one please help me out?? with a link to a code on setting up a server? or any thing, i just find lots of code to make the clients (that i can do) but his server thing is just not working.
Thanks
David