-
Create a Connection interface with open and close methods open (url, login , password )--> password as optional parameter -> console.log("method name , parameters...)
-
Create two classes OracleConnection and SQLConnection implementing connection class
-
Test the code
-
Create
Emp (empno, ename, salary) class Emp { empno: number; ename: string salary: number }
-
Create EmpDAO class constructor to accept Connection object Variable - arr:Array = new Array() Methods Insert - accept Emp object -> con.open(); console.log("in insert"); con.close() List - list the employees.
-
create a folder expressjs
-
on cmd prompt execute
`npm init -y`
-
Option 1-
npm install --save-dev [email protected] npm install --save-dev [email protected] npm install --save [email protected] npm install --save-dev @types/[email protected]
-
Option 2 - modify package.json to include
"devDependencies": { "@types/express": "^4.16.1", "tslint": "^5.12.1", "typescript": "^3.3.3" }, "dependencies": { "express": "^4.16.4" }
and invoke
`npm install`
node_modules\.bin\tsc.cmd -init
node_modules\.bin\tslint.cmd –init (tslint.json)
Modify package.json To include script line
` "start": "tsc && node dist/index.js" `
Starting server:
`npm start`