How to Import Export JavaDB(Database) in Netbeans?

UPDATED: 13 November 2010
JavaDB
Java DB is Oracle's supported distribution of the Apache Derby open source database. It supports standard ANSI/ISO SQL through the JDBC and Java EE APIs. Java DB is included in the JDK.

  • - Full-featured and easy-to-use
  • - Transaction-protected and crash-recoverable
  • - Embeddable in applications
  • - Pure Java and portable and across CDC FP 1.1, Java 5, Java 6, and Java 7 (everywhere from tablets to mainframes)


How to create JavaDB in Netbeans?

Step 1: Open service explorer in netbeans and navigate to Database > JavaDB > Create Database

JavaDB, Netbeans

Step 2: Provide Database Name, Username, Password and Database location in next popup. You are done with database creation in JavaDB. 


How to insert value in JavaDB in Netbeans?
If you are creating database for the first time in netbeans by following above steps. Then it'll show you the database instance right away. If you want to import it from other location then continue reading article till the end. I'm going to show you how you can import JavaDB in Netbeans.

Step 1: Connect the database instance that you created in above steps.

JavaDB, Netbeans

Step 2: You can create new schema in it. Or simple you can use APP schema. Open APP schema hierarchy > Table > Create Table

JavaDB, Netbeans

Step 3: Create table in next popup. 

Step 4: Right click on table and Insert record in it or by program. 


How to import JavaDB in Netbeans?

Step 1: Right click on JavaDB > Properties and change database location.

JavaDB, Netbeans

Step 2: Create New Connection.

JavaDB, Netbeans

Step 3: Provide database credential in next popup and click on ok.

JavaDB, Netbeans

2 comments :

  1. the URL does not work when i tried to import on another PC in the same network. Anyone know what is the problem?
    The error is
    cannot establish a connection to jdbc:derby://localhost:1527/MP using org.apache.derby.jdbc.ClientDriver (The connection was refused because the database MP was not found.)

    ReplyDelete
  2. http://www.javaquery.com/2010/10/how-to-use-oracle-database-in-java.html

    Check out the post and change the certain things in post like firewall and all if problem still exist than let me know.

    ReplyDelete