开发者

How to create table in MyEclipse Derby

where i can 开发者_如何学编程make the table when making sample program of Hibernate with MyEclipse Derby


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.

How to create table in MyEclipse Derby

How to create table in MyEclipse Derby

Figure 6. Connecting to Derby using the MyEclipse Derby driver


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:

How to create table in MyEclipse Derby

  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:

How to create table in 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜