Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Sunday, October 30, 2016

How to start using DerbyDB with Netbean?

Why we need to use DerbyDB, fisrt of all , it is shipped a long with Java JDK,

If you first learn Java and want to learn How Java work with Database,

We can use DerbyDB, Because we dont need to install a new DB that reason.

Another reason, I am wonder, how to use all tools shipped by Java JDK,

First Open Netbean,

Check Derby database configuration

Check configuration of JavaDB Choose location of JavaDB installed on your machine, normally the

DerbyDB was shipped along with JDK

 Right click on JavaDB --> Choose create new DB



After create DB success, a new database connection automatically created by Netbean,



Click on connect to



Netbean will automatically startup DerbyDB and Connect to that data.



 Now database is ready for futher more steps.

Wednesday, November 19, 2014

MONGODB BASIC CONFIGURATION

1. Mongodb without authentication


Mongodb folder structure

 C:\\mongodb\\bin
 C:\\mongodb\\data
Start mongoDB without authentication

C:\mongodb\bin\mongod.exe --dbpath "C:\mongodb\data"

or

C:\mongodb\bin\mongod.exe --dbpath="C:\mongodb\data"


Default port is 27017

2. Enable authentication



First we need to start mongoDB without authentication

C:\mongodb\bin\mongod.exe --dbpath "C:\mongodb\data"

After that run following commands :

1. Run  mongo client with : mongo.exe
2. Use data base with : use admin

3. Add user and role : db.createUser({"user":"root","pwd":"123456","roles":[{"role":"readWriteAnyDatabase","db":"admin"},{"role":"userAdminAnyDatabase","db":"admin"},{"role":"dbAdminAnyDatabase","db":"admin"}]})

The object of root user(for easy to read)


db.createUser({
 "user":"root",
 "pwd":"123456",
 "roles":[
  {
   "role":"readWriteAnyDatabase",
   "db":"admin"
  },
  {
   "role":"userAdminAnyDatabase",
   "db":"admin"
  },
  {
   "role":"dbAdminAnyDatabase",
   "db":"admin"
  }
 ]
});


And start with authentication mode:

 #mongod.exe --dbpath="C:\mongodb\data" --auth



3. Creating window service with configuration file


mongo.cfg placed in c:\mongodb\etc\

systemLog:
   destination: file
   path: c:\\mongodb\\etc\\mongodb.log
   logAppend: true
storage:
   dbPath: c:\\mongodb\\data
   journal: 
      enabled: true
processManagement: 
   windowsService: 
      serviceName: t2i-mongodb-server
      displayName: T2i mongoDb server display name.
      description: The service for MongoDatabase
security: 
   authorization: enabled
net:
   bindIp: 127.0.0.1
   port: 27017


Command to start as service

"C:\mongodb\bin\mongod.exe" --config "C:\mongodb\etc\mongo.cfg" --install

Tuesday, June 4, 2013

Compare Logical and Physical ERD

Entity relationship diagram (ERD) represents a detailed picture of the entities needed for a business. In forward engineering, ERD will be transformed into a relational database eventually. There are at least two types of ERD — Logical and Physical. They are used in different stages of development, and are inter-related.
Logical ERD models information gathered from business requirements. Entities and relationships modeled in such ERD are defined around the business's need. The need of satisfying the database design is not considered yet.
Physical ERD represents the actual design of database. It deals with conversion from logical design into a schema level design that will be transformed into relational database. When modeling a physical ERD, Logical ERD is treated as base, refinement occurs by defining primary keys, foreign keys and constraints. Sometimes, relationships need to be resolved by introducing additional tables, like a Linked table for a many to many relationship.
Since physical ERD and logical ERD represent the business requirement and database schema respectively, comparing physical and logical ERD helps to find out the differences between them, thus confirming the database is exactly following the initial business requirements regardless of the changes.

Visual Paradigm's Model Transitor enables you to transit a logical ERD to a physical ERD with the transition relationship well maintained. In this tutorial, we'll see how to make use of Model Transitor to transcribe a logical ERD into physical ERD. After that, we will make use of Visual Diff, a tool for comparing changes between diagrams, to trace the differences between them.

Source : Link