singh
singh

Reputation: 309

How to create table in MyEclipse Derby

where i can make the table when making sample program of Hibernate with MyEclipse Derby

Upvotes: 0

Views: 5439

Answers (2)

UdayKiran Pulipati
UdayKiran Pulipati

Reputation: 6667

Follow the steps below:

1.For creating table in MyEclipse Derby first of all select open perspective in MyEclipse IDE at top right corner, image shown below:

MyEclipse Database Explorer Showview

  1. Right click on MyEclipse Derby and click Open connection
  2. Right click on Connected to MyEclipse Derby [classiccars] and click on New SQL Editor, image shown below:

Connnected to MyEclipse Derby

  1. In Editor window write the code shown below:

CREATE TABLE APP.EMPINFO (EMP_ID INT NOT NULL, FIRSTNAME VARCHAR(20), MIDDLENAME VARCHAR(20), LASTNAME VARCHAR(20), DATEOFBIRTH DATE NOT NULL, EMAIL VARCHAR(50), ATTACHMENT VARCHAR(5000), PHONENO integer, ADDRESS VARCHAR(256), PINCODE integer, CONSTRAINT EMPID_PK PRIMARY KEY (EMP_ID));

Here APP is schema name and EMPINFO is table name.

How to create table in MyEclipse Derby is shown in New SQL Editor:

How to create table in MyEclipse Derby

Upvotes: 0

Pascal Thivent
Pascal Thivent

Reputation: 570325

From the MyEclipse Derby Database Server Tutorial (and I warmly recommend reading it entirely):

Connecting to Derby with the Database Explorer

Switch to the MyEclipse Database Explorer perspective. Please make sure Derby, is started and running before you attempt to connect to it. In the DB Browser view, right click the MyEclipse Derby driver and then select Open connection... to connect.

Note: If you do not see the MyEclipse Derby driver, see Restore MyEclipse Derby Driver in the following section.

You may use the embedded Derby database just like you would any other database in MyEclipse. For further details, refer to the Database Explorer tutorial.

MyEclipse Derby ships with a sample database named myeclipse. This database includes two sample schemas, CLASSICCARS and MYBLOG. Other schemas visible are Derby's system schemas.

alt text alt text

Figure 6. Connecting to Derby using the MyEclipse Derby driver

Upvotes: 1

Related Questions