NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Unleash
Joined: 19 Sep 2008 Posts: 12 Location: Brazil
|
Posted: Thu Apr 16, 2009 1:24 pm Post subject: Internal Exception: java.sql.SQLSyntaxErrorException |
|
|
Hi !
Here's the code i use to start a javadb server and connect to my database:
NetworkServerControl s;
try {
s= new NetworkServerControl();
s.start(null);
}catch (Exception ex){
System.out.println(ex.getMessage());
}
try{
Connection con = DriverManager.getConnection("jdbc:derby:CRHDatabase", "CRH", "crh");
launch(CRHDatabaseApp.class, args);
}catch (Exception ex){
System.out.println("Erro na execução: " + ex.getMessage());
}
And i got the message:
Internal Exception: java.sql.SQLSyntaxErrorException: O esquema 'CRH' não existe
It means that the schema 'CRH' does'nt exist.
My user name is the same of the schema name, so what can be happenning ? |
|
| Back to top |
|
 |
benoit_rouleau
Joined: 14 Apr 2009 Posts: 5
|
Posted: Thu Apr 16, 2009 3:37 pm Post subject: |
|
|
I am not familiar with Derby but using postgres you need to provide a host and a port to the connection string like so:
jdbc:postgresql://localhost:5432/main
Hope this helps |
|
| Back to top |
|
 |
Unleash
Joined: 19 Sep 2008 Posts: 12 Location: Brazil
|
Posted: Thu Apr 16, 2009 4:14 pm Post subject: |
|
|
According to derby's documentation, when using the embedded driver, the connection doesn't need neither host or port !
But thanks anyway !! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|