db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kaoullas, Adamos D" <a.kaoul...@imperial.ac.uk>
Subject Obtaining JDBC connection using Derby embedded driver takes a long time...
Date Wed, 09 Feb 2005 18:20:54 GMT
Greetings all,
 
I am using Derby as an embedded database for an application I am
developing. I am obtaining a JDBC connection using the DriverManager
class. I am then using this connection to execute a series of SQL
statements and thereby create my database tables. It seems to take a
very long time to do this. It takes approximately 8 seconds to obtain
the connection, and  a further 8 seconds to execute about 10 CREATE
table statements. Is this normal? I am using version 10.0.2.1 on Windows
XP. I have a attached a test program I wrote to show how I am starting
the database:
 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class TestDerbyDB {
	public static void main(String[] args) {
		System.out.println("loading jdbc driver");
		try {
	
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
			System.out.println("JDBC driver loaded
succesfully");
			System.out.println("creating database");
			Connection conn = DriverManager
	
.getConnection("jdbc:derby:c:/temp/Wombat2DB;create=true");
			System.out.println("database created");
		} catch (SQLException ex1) {
			ex1.printStackTrace();
		} catch (ClassNotFoundException ex) {
			ex.printStackTrace();
		}
	}
}

Kind regards,

Adam Kaoullas

Mime
View raw message