NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Internal Exception: java.sql.SQLSyntaxErrorException

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
Unleash



Joined: 19 Sep 2008
Posts: 12
Location: Brazil

PostPosted: Thu Apr 16, 2009 1:24 pm    Post subject: Internal Exception: java.sql.SQLSyntaxErrorException Reply with quote

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

PostPosted: Thu Apr 16, 2009 3:37 pm    Post subject: Reply with quote

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

PostPosted: Thu Apr 16, 2009 4:14 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo