INSTALLATION DOCUMENTS BY RAVI

Showing posts with label OTHERS. Show all posts
Showing posts with label OTHERS. Show all posts

Sunday, February 16, 2020

Loading xml file data to oracle table using python


Sample xml file (test.xml):

<?xml version="1.0"?>
<data>
    <customer name="Ravi" >
        <email>lravikumarvsp@gmail.com</email>
        <phone>9999999999</phone>
    </customer>
    <customer name="kumar" >
        <email>kumar@gmail.com</email>
    </customer>
    <customer name="lanke" >
        <email>lanke@gmail.com</email>
        <phone>8888888888</phone>
    </customer>
    <customer name="ravikumar" >
        <phone>7777777777</phone>
        <address>
            <street>kukatpally</street>
        </address>
    </customer>
</data>




Python script for parsing xml file data to data frame:

import pandas as pd
import xml.etree.cElementTree as et
#Reading Data from the xml file
parsedXML = et.parse( "test.xml" )                                                                         
dfcols = ['name','email','phone','street']                                                                                
df = pd.DataFrame(columns=dfcols)
def getvalueofnode( node ):
                return node.text if node is not None else None
for node in parsedXML.getroot():                                                                              
                name = node.attrib.get('name')
                email = node.find('email')
                phone = node.find('phone')
                street = node.find('address/street')
                df = df.append( pd.Series([name, getvalueofnode(email), getvalueofnode(phone), getvalueofnode(street)], index=dfcols) ,ignore_index=True)
print (df)                                                                                                                                  










Run the program as below:















Now create a table with column names in the data frame.

CREATE TABLE TEST 
   (                          "NAME" VARCHAR2(200 BYTE),
                               "EMAIL" VARCHAR2(200 BYTE),
                               "PHONE" VARCHAR2(200 BYTE),
                               "STREET" VARCHAR2(200 BYTE)
   )





















Python script for loading xml file to oracle table.

import pandas as pd
import cx_Oracle
import xml.etree.cElementTree as et
#Reading Data from the xml file
parsedXML = et.parse( "test.xml" )                                                                         
dfcols = ['name','email','phone','street']                                
df = pd.DataFrame(columns=dfcols)
def getvalueofnode( node ):
                               return node.text if node is not None else None
for node in parsedXML.getroot():                                                                               
                               name = node.attrib.get('name')
                               email = node.find('email')
                               phone = node.find('phone')
                               street = node.find('address/street')
                               df = df.append( pd.Series([name, getvalueofnode(email), getvalueofnode(phone), getvalueofnode(street)], index=dfcols) ,ignore_index=True)
print (df)                                                                                                                             
#Loading Data into the Database Table
host1 = '172.16.11.32'
port1 = '1521'
sid1 = 'srcdb'
schema1 = 'system'
pwd1 = 'Admin123'
sdsn = cx_Oracle.makedsn(host1, port1, service_name=sid1)    
connect=cx_Oracle.connect(schema1, pwd1, sdsn)                                                        
cursor=connect.cursor()
dataframe_list=df.values.tolist()                                                                                                              # convert the dataframe to list
sql='INSERT INTO TEST values (:1,:2,:3,:4)'
for index,elem in enumerate(dataframe_list):                                                   
                               cursor.execute(sql,dataframe_list[index]) 
                               connect.commit()                                                             













Run the script to load the data to oracle table now















Check the table for data






















Wednesday, December 4, 2019

How to find WiFi password using windows command prompt

Note: This will show the passwords of wifi networks which you connected at least ones.

Open the command prompt as Administrator



















Enter the below command to list the wifi profiles you connected so far
netsh wlan show profile




















Enter the below command to see the password of the wife network
netsh wlan show profile wifi-name key=clear



Tuesday, July 23, 2019

Connecting Microsoft SQL Server using Oracle SQL developer


We can connect Microsoft SQL server using oracle SQL developer by following the steps below.



Download “jTDS-SQL Server and Sybase JDBC driver”.





















Open SQL developer



















Click on Tools and then click on Preferences



















Under Database Click on Third Party JDBC Driver



















Add the downloaded SQL server JDBC driver and click on ok


















Try to create a new connection, we will see SQL Server option now.

Select SQL Server and provide the connection details and Click on Test.
We will get a Success status.
























Friday, May 31, 2019

Converting bat file to exe


Sample bat file:
Create a sample bat file as below
























By executing this bat file we will get the below output













Converting bat files to exe:
Download and install bat to exe converter as below






































Run the installer as administrator and
Provide the bat file to convert to exe and click on complete
























This will create a exe file as below























Double click the exe file to see the output
















Saturday, March 23, 2019

Step by step installing XAMPP


XAMPP:
XAMPP is an open source cross platform web server, MySQL database engine, and PHP and Perl package. It is compiled and maintained by apache. The acronym XAMPP stands for;
  • X – [cross platform operating systems] meaning it can run on any OS  Mac OX , Windows , Linux etc.
  • A – Apache - this is the web server software.
  • M – MySQL - Database.
Use of XAMPP:
  • In order to use PHP, you will need to install PHP, Apache and may be even MySQL. It’s not easy to install Apache and configure it. If you install Apache on its own, you will still have to set it up and integrate it with PHP and Perl among other things. XAMPP deals with all the complexity in setting up and integrating with PHP and Perl. Unlike Java that runs with the Java SDK only, PHP requires a web server to work
  • XAMPP provides an easy to use control panel to manage Apache, MySQL and other programs such as Tomcat, filezilla etc. You don’t have to memorize commands for starting apache, MySQL etc.
Step by step installing XAMPP:
Double click on the downloaded software























We will get a warning message as below










As per the warning message disable the UAC or install the software other than program files 

In the welcome screen click on next




















Select all the components and click on Next





















Provide the installation directory for XAMPP and click on Next




















Click on Next




















Click on Next




















Wait until the installation got finished








































Click on Allow access

















Check start control panel option and click on Finish




















Select the language and click on save


















We will get a XAMPP control panel as below
















Here we started Apache server and mysql by clicking on start button adjacent to them


















By clicking on Admin button belong to Apache we can access the dashboard page as below




















Creating MySQL database:

Click on Admin button of MySQL

















In the admin console click on New



















Provide name for the database and click on create



















We can create tables on the newly created database  by using Create table option



















Creating a table “nametable” with two columns






































Connecting to sql work bench and checking for the table created


















  Opatch reports 'Cyclic Dependency Detected' error when patching ODI   Issue: When applying a Patch Set Update (PSU) to WebLogic Se...