8 Replies - 677 Views - Last Post: 29 June 2016 - 11:22 PM

#1 karengsh   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 132
  • Joined: 18-May 09

Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 03:53 AM

Hi,

I am looking at certain code snippet from online tutorial but they don't include the database schema.

Hence, I would like to know is it possible to tell the database schema by just the Models alone or what other classes I should take into consideration ?

Tks.
Is This A Good Question/Topic? 0
  • +

Replies To: Is it possible to tell what is the database schema based on Java Model

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14175
  • View blog
  • Posts: 56,787
  • Joined: 12-June 08

Re: Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 08:15 AM

It sort of depends what they show you. Sometimes you can piece it together.. sometimes you can't.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw   User is offline

  • Bouncy!
  • member icon

Reputation: 6563
  • View blog
  • Posts: 26,615
  • Joined: 12-December 12

Re: Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 08:20 AM

Why don't they include the database schema? Is it not available at the beginning or end of the tutorial, or as a link to another page?

Which tutorial is it?
Was This Post Helpful? 0
  • +
  • -

#4 karengsh   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 132
  • Joined: 18-May 09

Re: Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 09:34 AM

View Postandrewsw, on 26 June 2016 - 08:20 AM, said:

Why don't they include the database schema? Is it not available at the beginning or end of the tutorial, or as a link to another page?

Which tutorial is it?


This is the tutorial I am trying to replicate :

http://mrbool.com/ha...sing-jdbc/27571
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw   User is offline

  • Bouncy!
  • member icon

Reputation: 6563
  • View blog
  • Posts: 26,615
  • Joined: 12-December 12

Re: Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 09:48 AM

The author says "So here are our DAO interfaces (skipping implementation as this is not our main topic)". As the tutorial is entitled "Handling multiple transaction in J2EE application using JDBC" I suppose it is reasonable for him to assume a certain level of knowledge.

Do you specifically want to study multiple transactions and concurrency? If not, then this tutorial may not be appropriate for you at this time.
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw   User is offline

  • Bouncy!
  • member icon

Reputation: 6563
  • View blog
  • Posts: 26,615
  • Joined: 12-December 12

Re: Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 09:59 AM

Note that you don't have to quote the previous post, there is a Reply button further down the page, or use the Fast Reply box.
Was This Post Helpful? 0
  • +
  • -

#7 karengsh   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 132
  • Joined: 18-May 09

Re: Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 08:07 PM

Yes. I need to know about transactions. It is very important for me to understand before I move on the EJB and my school is going to start soon and yet I am still struggling about this topic based only on J2EE...

Could you advice on the database table based on the tutorial ?
Was This Post Helpful? 0
  • +
  • -

#8 andrewsw   User is offline

  • Bouncy!
  • member icon

Reputation: 6563
  • View blog
  • Posts: 26,615
  • Joined: 12-December 12

Re: Is it possible to tell what is the database schema based on Java Model

Posted 26 June 2016 - 10:08 PM

I suppose I could if I was forced to. But no, I won't be delving into it.

I don't like that tutorial. There is too little text (and poor text) in comparison to code, not to mention the missing parts. He also doesn't distinguish clearly between bank transactions and database transactions, nor describe the imports that he uses.

I'd hunt around for different tutorials.

Locking and Concurrency in Java Persistence 2.0
Java EE Concurrency API Tutorial

BTW I don't use J2EE. These tutorials just looked reasonable to me.

If you are obliged to complete that particular tutorial then I would do a lot of reading around, and complete other short tutorials, to help make some sense of it. If your database knowledge is light then you need to study databases and database interactions/connectivity, first.
Was This Post Helpful? 0
  • +
  • -

#9 karengsh   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 132
  • Joined: 18-May 09

Re: Is it possible to tell what is the database schema based on Java Model

Posted 29 June 2016 - 11:22 PM

Actually, I am really a newbie in transaction so I am hoping for a step by step tutorial.

In any case, what would be a database schema be like for a bank transaction?

This is something I have worked out so for :

create database bank;
use bank,
Drop table if Exists 'bank'.'account';
Create Table 'bank'.'account'(
'AccountId' varchar(50) Not Null,
'AccountType' varchar(50) Not Null,
'OpenBalance' int (50000) Not Null,
'AccUserName' varchar(50) Not Null,
'TransAmount' int(50) Not Null,
Primary Key ('AccountId'))
ENGINE=INNODB;

Drop table if Exists 'bank'.'transaction';
create Table 'bank'.'transaction';
'transactionId' varchar (50) Not Null,
'transAmount' int(50000) Not Null,
'transType' varchar(3) Not Null,
'transDate' DATETIME Not Null,
'OpenBalance' int(50000) Not Null,
Primary Key ('transactionId')

Please give me your advice if I have missed out anything ?

Tks.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1