Try the more secure way - I think I got it from documentation.
Create a properties object with the needed definitions (keys).
Then Call drivermanager with (url,properties_obj)
(the properties way seems to be the less stony way to derby)
Properties sd = new Properties();
sd.setProperty("shutdown", "true"); // extra properties
try {
DriverManager.getConnection(connectionURL, sd);
} catch (SQLTransientConnectionException sex) {
sex = null;
Logger.getLogger(Fetcher.class.getName()).log(Level.INFO, "SHUTDOWN",
sex);
}
Hope this helps.-)
Erik
-----Original Message-----
From: sivagururaja [mailto:[email protected]]
Sent: 8. juli 2009 07:01
To: [email protected]
Subject: Re: Close Derby DB
Thanks Dag,
I am giving the valid path. I can able to connect the database.
Only thing is, if i am using "shutdown=true", i got this error.
Dag H. Wanvik wrote:
>
> 'C:/MyDB' not found seems to indicate that the database hasn't been
> created yet. Are you using the exact same string as in the connect
> statement where you created the database?
>
> If you are running with sqlAuthorization enabled, only the database
> owner can shut down. The owner is the user name you provided when you
> created the database.
>
>
While i am creating the database through NetBeans 6.5, i mentioned the
database name, username and password. How i know whether i have enabled
the
sqlAuthorization or not.
Regards
Sivagururaja
--
View this message in context:
http://www.nabble.com/Close-Derby-DB-tp24372778p24385296.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.