Results 1 to 2 of 2
Thread: Can't connect after build..
- 03-21-2010, 06:14 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 41
- Rep Power
- 0
Can't connect after build..
Hi,
I am using NetBeans 6.8. i have connected to database. I have completed my task. When i run the program under NetBeans, the program can communicate with the database. But after i build the program, my app can't communicate.
I have noticed this. When i manually connect to database thru NetBeans (right click to JavaDB node and click connect) the app runs well. But when i disconnect, it doesnt connect itself from coding.
This is what my code does after clicking the connection button:
I am also not sure what driver to use, embedded or client..? database will be reached locally only.Java Code:Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); con = DriverManager.getConnection("jdbc:derby://localhost:1527/SLearning","Learn","Learn"); stmt = con.createStatement();
do i need to add something else to connect manually.
I hope i made myself clear..
Thanks.
- 03-21-2010, 06:26 AM #2
Member
- Join Date
- Mar 2010
- Posts
- 41
- Rep Power
- 0
Solved
Oh, sorry..
I have just noticed that the code should be like this..
I used "localhost" with EmbeddedDriver.. that's why it cannot find my database and connect.. when i connect thru NetBeans it cannot find either. but it connects using NetBeans connection..Java Code:Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); con = DriverManager.getConnection("jdbc:derby:<databaseName>","Learn","Learn"); stmt = con.createStatement();
Anyway thanks..
Similar Threads
-
ant build dependencies
By sardare in forum New To JavaReplies: 0Last Post: 04-02-2009, 10:59 PM -
ant build
By sardare in forum New To JavaReplies: 4Last Post: 04-02-2009, 10:02 PM -
Unable to build
By jkeller in forum EclipseReplies: 1Last Post: 01-15-2009, 06:56 PM -
clean and Build
By bhanu in forum EclipseReplies: 3Last Post: 07-03-2008, 01:13 PM -
To those who want to build a new OS, you may read this for a while...
By sukatoa in forum Forum LobbyReplies: 0Last Post: 06-11-2008, 01:56 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks