Skip to main content

Posts

Showing posts from April, 2020

Steps to start derby database

C:\Users\AnilBalwani> java -jar C:\Users\AnilBalwani\Downloads\db-derby-10.14.2.0-bin\db-derby-10.14.2.0-bin\lib\derbyrun.jar Usage: java -jar derbyrun.jar ij [-p propertiesfile] [sql script] java -jar derbyrun.jar sysinfo [-cp ...] [-cp help] java -jar derbyrun.jar dblook [args] (or no arguments for usage) java -jar derbyrun.jar server [args] (or no arguments for usage) java -jar derbyrun.jar SignatureChecker [args] java -jar derbyrun.jar PlanExporter [args] C:\Users\AnilBalwani> java -jar C:\Users\AnilBalwani\Downloads\db-derby-10.14.2.0-bin\db-derby-10.14.2.0-bin\lib\derbyrun.jar ij ij version 10.14 ij> CONNECT 'jdbc:derby:booksdb;create=true'; ij> CREATE TABLE book (book_id int primary key, title varchar(64)); 0 rows inserted/updated/deleted ij> INSERT INTO book VALUES (1, 'Core Java'), (2, 'Thinking in Java'), (3, 'Effective Java'); 3 rows inserted/updated/deleted ij> CONNECT 'jdbc:derby://localhost:1527/project...

Python HTTP Request

import requests,json print(requests.get('https://api.github.com')); # Getting response in json format response=requests.get('https://api.github.com'); #print(response.json()); #print(response.headers); print(response.headers['content-type']); print(response.headers['date']);

Reading JSON File using Python

Code to Read Json File using Python >>> import os >>> os.chdir(r"C:\Users\AnilBalwani\Desktop"); >>> f=open("hello.json"); >>> print(json.load(f)); {'glossary': {'title': 'example glossary', 'GlossDiv': {'title': 'S', 'GlossList': {'GlossEntry': {'ID': 'SGML', 'SortAs': 'SGML', 'GlossTerm': 'Standard Generalized Markup Language', 'Acronym': 'SGML', 'Abbrev': 'ISO 8879:1986', 'GlossDef': {'para': 'A meta-markup language, used to create markup languages such as DocBook.', 'GlossSeeAlso': ['GML', 'XML']}, 'GlossSee': 'markup'}}}}}

Reading a file in oracle

create a directory using sqlplus sys / as sysdba create directory create directory test as 'C:\test' grant access for read and write to db Grant read,write test to public; copy your file emp.txt with data DECLARE   L_HANDLER UTL_FILE.FILE_TYPE; L_TEST VARCHAR2(1000); BEGIN   L_HANDLER := UTL_FILE.FOPEN('TEST', 'EMP.txt', 'R');  UTL_FILE.GET_LINE(L_HANDLER,L_TEXT); DBMS_OUTPUT.PUT_LINE(L_TEXT); END;

PIP Tool Python

PIP is tool for installing library. IT is used for installing/listing/deleting library. To search for python libraries https://pypi.org/search/ pip install qbill To check installation pip show qbill

PIP syntax error python

PIP syntax error python  Open command prompt. Check python version run command like  pip install qrbill --user (--user is optional if you have access denied issue ) Steps to install package in python is Microsoft Windows [Version 10.0.18363.778] (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\AnilBalwani>python --version Python 3.8.2 C:\Users\AnilBalwani>pip --version pip 19.2.3 from c:\program files (x86)\python38-32\lib\site-packages\pip (python 3.8) C:\Users\AnilBalwani>python -m pip install --upgrade pip setuptools wheel Collecting pip   Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)      |████████████████████████████████| 1.4MB 386kB/s Collecting setuptools   Downloading https://files.pythonhosted.org/packages/a0/df/635cdb901ee4a8a42ec68e480c49f85f4c59e8816effbf57d9e6ee8b3588/setuptools-4...

Maximo Integration Framework

Maximo Integration framework is used for integrating with external application or system or for loading data. Its heart is object structure. It supports following file formats JSON, XML, CSV etc. You can integrate via Webservice Soap/Rest, JMS , HTTP etc. You can also define a particular time during a day to synchronize or can be in real time. Main integration components and there use in Layman terms : - Object Structure  : List of Objects Publish Channel : Used to send data or Publish data Enterprise Service : Used to receive data from external system Invocation Channel : Used for Send and receive data at particular event External system : you define a virtual name for external system you are integrating. Endpoint : - Its a gate through which data goes in and out. For business logic we can do XSL Mapping, Java classes or processing rules.

Hellow World program in python

# Hello World program in Python import datetime,time,sys def welcome():     print("Hi How are you" +str(datetime.datetime.now()));                    #prints date and time     print("Hope you are having a great day");     print("Welcome to python");     time.sleep(1);        #cause program to wait for 1 second welcome(); welcome(); exit(); This program creates welcome function, shows you how to import or do multiple import and print datetime. with params # Hello World program in Python import datetime,time def welcome(number):     print("Hi How are you" +str(datetime.datetime.now()));     print("Hope you are having a great day"+str(number+1));     print("Welcome to python");     time.sleep(1); welcome(6); Python Creating class example class Person:     d...

Getting started with PLSQL

PLSQL Basics Structure of PLSQL Block Declare                      (Optional) BEGIN                      (Required)        Sql statments        IF....While...For....Else....Do....While Exception                  (Optional) End ;                       (Mandatory) Types of blocks in PLSQL 1. Anonymous Structure : Declare                      (Optional) BEGIN                      (Required)        Sql statments        IF....While...For....Else....Do....While Exception                  (Optional) End       ...

Steps to create user in database

Creating test user in oracle database alter session set container=testdb--only for 12c create user test identified by test; grant create session to test; grant create table,create view to test; grant  create procedure to test; grant create synonym, create trigger to test; grant unlimited tablespace to test;