Total Pageviews

Wednesday, November 2, 2011

How-To Connect SquirreL to the Store and Corporate Databases


Squirrel Overview


If it becomes necessary to connect directly to the store or corporate databases, SQuirreL is considered one of the best clients to use.
SQuirreL SQL Client is a graphical Java program that will allow you to view the structure of a JDBC compliant database, browse the data in tables, issue SQL commands etc, see Getting Started and Introduction. The minimum version of Java supported is 1.6.x as of SQuirreL version 3.0. See the Old Versions page for versions of SQuirreL that will work with older versions of Java.

Assumptions

Windows XP
Java 1.6.x is installed
JAVA_HOME points to the Java 1.6.x installation


Required Software

SQuirreL
Oracle Thin JDBC driver (ojdbc6.jar)


Solution

Install SQuirreL
java -jar squirrel-sql--install.jar
Add the Oracle Driver
Click the ‘Drivers’ tab
Scroll down to ‘Oracle Thin Driver’
‘Drivers | Modify Driver…’
Click the ‘Extra Class Path’ tab
Click the ‘Add’ button
Navigate to ojdbc6.jar and click ‘Open’
Click ‘OK’
Create a New Alias for the Store Database
‘Aliases | New Alias…’
Set ‘Name’ to:
Store Database
Select ‘Oracle Thin Driver’ from the Driver drop-down list
Edit the URL to:
jdbc:oracle:thin:@orstores:1521:oretail
Set ‘User Name’ to:
bo
Set ‘Password’ to:
bo
Check the ‘Auto logon’ box
Click the ‘Test’ button
If successful, click the ‘OK’ button
Click the ‘OK’ button
Create a New Alias for the Store Database
‘Aliases | New Alias…’
Set ‘Name’ to:
Corporate Database
Select ‘Oracle Thin Driver’ from the Driver drop-down list
Edit the URL to:
jdbc:oracle:thin:@orstores:1521:oretail
Set ‘User Name’ to:
co
Set ‘Password’ to:
co
Check the ‘Auto logon’ box
Click the ‘Test’ button
If successful, click the ‘OK’ button
Click the ‘OK’ button
Connect to the Database :-
Select one of the aliases
‘Aliases | Connect’


How to connect with Offline DB..




For detail ...


        

Wednesday, October 5, 2011

CPIO (Sigcap) Device configuration with ORPOS Client

Electronic Signature Capture Pads (CPIO)

Electronic signature capture pads or cpio device and software allow you to capture digital signatures to your point of sale system.  There are few famous vendor of CPIO such as verifone , topaz ,Honeywell , Symbol, ID Tech, etc Each vendor offers different types of devices now its choice of retailer which meets there business requirements.

The installation and configuration of these devices are almost same but there are few configuration changes which vary from one device to another. Here i am covering the configuration and installation process for verifone CPIO MX850/MX860/MX870 series which is same.

CPIO Configuration :-

Driver Installation :- very first you need to install the java if it is not on your POS client machine.if it verify the version it should be jre/jdk1.5_xxx or higher.

Verifone MX860/MX850/MX870


  • Install USB Driver for your Verifone device.
  • Flash ROM, MX OS,
  • FormAgent/IBM EFT, and Retailer Screens to upload screen of CPIO .

Configure with USB Port :- First verify that USB port is open and have read only access only if not than first do it. After installing driver restart the register or your local machine connect CPIO device, right click on mycomputer than click on device manager it will display list of devices and ports, click on Ports and verify that there should be Mx860 device (COM9).

















Now you need to configure this device to Oracle POS Client

ORACLE POS Client File Configurations Changes:-

JRE Related Changes -

Ibmcomm.dll

Instructions:              Paste file in folder                                                                                                 File:                            ibmcomm.dll                                                                                                           Directory Location:   C:\Program Files\JRE6\bin\ 

(This Jre should be pointed by POS Client if there are more than one jre)
 
Javax.comm.properties

 Instructions:              Paste file in folder
 File:                            javax.comm.properties 
Directory Location:   C:\Program Files\JRE6\lib\
 * (This Jre should be pointed by POS Client if there are more than one jre)

Comm.jar

Instructions:              Paste file in folder                                                                                               File:                            comm.jar

Directory Location:   C:\Program Files\JRE6\lib\ext\

* (This Jre should be pointed by POS Client if there are more than one jre)

Jposdrivers

Instructions:              Drop folder and contents into directory structure 
Folder             :           jposdrivers or any name
Directory Location:   C:\Program Files\ or any user define location
* (These drivers entry should be inside Posenv.bat)
 

Pospal-verifone.jar

Instructions:              Paste file in folder if not
File:                            Pospal-verifone.jar
Directory Location:   ..\..\\360common\lib
Posdevices.xml
Instructions:              Replace file in folder
File:                            posdevices.xml
Directory Location:  ..\..\\pos\config\devices\

DeviceContext.xml
Instructions:              Replace file in folder
File:                            DeviceContext.xml
Directory Location:   ..\..\\pos\config\context\

Posenv.bat
Instructions:              Modify existing file
File:                            posenv.bat
Directory Location:   ..\..\pos\bin\

jpos.xml

Instructions:              Replace existing file
File:                             jpos.xml
Directory Location: ..\..\pos\bin\


Add the following to the Posenv.bat file inside ../../Client/pos/bin folder

#Set CPIO Related jars and Classes

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::

call C:\jposdrivers\jposenv.bat
SET CLASSPATH=%CLASSPATH%;%_360COMMON_PATH%\lib\pospal-common.jar;
SET CLASSPATH=%CLASSPATH%;%_360COMMON_PATH%\lib\pospal-verifone.jar;

Now test your CPIO configuration by launching ORPOS Client. :) :)

 




Monday, October 3, 2011

How to Prevent Putty Session being inactive...................

I am frequent user of putty many time when i left my desk for couples of minutes or more than 15 min sometimes there is  Putty (inactive) problem occurs, i lost control the server which i was accessing from putty. When i went to depth of this problem i found it happens because servers are usually configured to disconnect idle sessions after they are inactive for a particular time. This has many disadvantages. You can no longer monitor the jobs running in the background and the UP arrow for previous commands may not work. And you have to enter the username and password again after restarting the session.

This is how you keep it alive for longer periods
  • open putty , Right click on Putty title bar, then click onchange setting option.

  • Before saving a session, click on Connection in the left pane.

  • Enter a number, in place of zero, in the text box. as i changed from 0 to 30. Save this by pressing apply button.
  • Now go back and save your session so that this setting will be same for future .

This way, the session sends a keep-alive request to the server every 30 seconds. Hence, it stays active.

Wednesday, September 28, 2011

How to take Java Thread Dump?

A java thread dump is a way of finding out what each thread in the JVM is doing at a particular point of time. This is especially useful when your java application seems to hang when running under load. Thread dump will help you to find out where the threads are stuck.

How to take thread dump on UNIX:
First, find the process id by looking in the process table. You can generally get the process numbers of all running Java processes with the command:
ps axf | grep java
or
ps -ef | grep java | grep -v grep

Run the following command to take the thread dump.
Kill –QUIT process_id

The thread dump will be sent to where ever the standard output is redirected to. (In tomcat, normally the thread dump will be sent to TOMCAT_HOME/logs/Catalina.out)
QUIT signal does not actually kill the java process. The thread dump will be sent to the standard output and the process will continue.

How to take thread dump on Windows:
press CTRL+Break
The thread dump is printed in the command window, and you must mark and cut / paste to a separate file in order to continue working on it.



What happens when you take thread dump?
i). The Java process is paused — all threads simply stop dead in their tracks
ii)). The Main java process asks each thread in turn to give a complete account of what they’re doing
iii). The thread dump is sent to standard error, or somewhere else, depending on your Java vendor
iv)-. The Java process is unpaused — all threads simply continue where they left off.
v)-The Java process usually keeps on running, and the whole process only takes a few seconds. Any activity, even input/output is suspended. After the thread dump has completed, everything returns back to normal, just as if nothing had happened.


A sample thread dump is given below.

Monday, September 12, 2011

Windows COM Ports equivalent in Linux (Suppose if ORPOS client will run on Linux)

I shall list the Linux equivalent of the Windows COM ports. This information is asked during the configuration or installation of various softwares, so its best if you make a list of of 'Which Hardware - Which Port' for your machine, so that in future you can refer to it whenever required.

My System Setup : 
The table shows the setup one of my machine.

Remember that the translation of the Com Ports -> Linux files is the same everywhere, but your particular hardware may not be on the same Windows Com Port as this machine. What I mean is, Com 1 in Windows is /dev/ttyS0 in Linux everywhere. But the mouse need not necessarily be present on Com 1. The mouse might be present on some other Com Port. You should know which hardware is on which Windows Com Port on your machine.

My DevicesWindows Com PortLinux equivalent
MouseCOM 1/dev/ttyS0
External ModemCOM 2/dev/ttyS1
Floppy DriveNormal Floppy cable/dev/fd0
PrinterLpt Port/dev/lp0
CDROM DriveIDE cable/dev/cdrom







Saturday, August 27, 2011

FTP Server Configuration on Linux (Redhat/SUSE)

This tutorial will help you while configuring ftp server on linux box. Follow the steps below given.
Server Side Configuration.
Step 1:install ftp package if not installed
#yum install vsftpd                                                                                                                 
 or rpm -ivh vsftpd.....

 Step 2:restart the ftp service
#chkconfig vsftpd on
#service vsftpd restart


Step 3: Modify vsftpd according to your use for user login and other access privileges
vi /etc/vsftpd/vsftpd.conf
userlist_enable=YES
Step 4: add the user entry in user_list file
#vim /etc/vsftpd/user_list
kapil

Your local ftp server will installed on your Linux and will be accessible through LAN.
Configuration may very from one linux to other linux.

Friday, August 26, 2011

SSH (Remote machine login) without password

This tutorial will help you how to SSH to a remote machine without typing your password. You can use this technique if you find yourself logging in to the same machine frequently and find typing your password tedious. It is also useful in scenarios when you have a script which needs to pull some files from a remote machine or perform a task on a remote machine via SSH, and you want to run this script automatically without having a human to type a password.
These instructions work on Linux and Mac. You can achieve the same result on Windows using Putty.(Not tested)

Step 1: On local machine: Generate Authentication Keys

Authentication keys are a pair of private and public keys. The public key is like your login. Unlike a conventional login name, the public key is 2-3 lines long and looks like garbage or claptrap. Don’t worry, you never have to type it manually. Your private key is like your password, but much longer that a regular password. You can generate your public and private keys by typing the following command:

test@suse123> ssh-keygen -t rsa 

Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/kapil/.ssh/id_rsa):
 
Accept the default choice. Hit enter.Hit enter twice.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

A passphrase encrypts your private key so that no one can see it. However, you should NOT encrypt your private key if you want a password-less login.

The key fingerprint is:
5e:26:54:34:a1:28:18:68:11:11:7d:8d:c6:d5:4b:bf kapil@infogain.com
 

What happened after running the command?

On your local server you just created 2 files in your ~/.ssh directory.

  • cd ~/.ssh  
  • ls -l

-rw------- 1 kapil test 1675 2011-08-17 17:27 id_rsa
-rw-r--r-- 1 kapil test  411 2011-08-17 17:27 id_rsa.pub
id_rsa contains your private key. 
id_rsa.pub contains your public key. 
 
 

Step 2 : On remote machine: authorize password less login

Login to remote machine 

ssh hostname -l username

The authenticity of host 'infogain.com (XXX.XXX.XXX.XX)' can't
be established.RSA key fingerprint is 
44.2b:93:ce:1b:1b:99:3a:6d:91:d1:50:aa:0d:87:40.
Are you sure you want to continue connecting (yes/no)? yes (yes and hit enter)
 
Warning: Permanently added 'infogain.com ,XXX.XXX.XXX.XX' (RSA) to the 
list of known hosts.
username@infogain.com's password: Enter your password, and hit enter.

Create a .ssh directory on the remote machine and create a authorized_keys
 file in that directory. You need to copy the entire contents of your 
local machine’s ‘id_rsa.pub’ and paste it in the .authorized_keys file 
on the remote server. 
  • mkdir -p .ssh  
  • chmod 700 .ssh  
  • cd .ssh  
  • touch authorized_keys (Not necessary for use to modify timestamp)
  • chmod 600 authorized_keys  
  • vi authorized_keys  
  • # Do not forget to copy-paste the entire contents of your local machine's ~/.ssh/id_rsa.pub file in authorized_keys  
  • # logout  
  • exit 

Note **: Make sure you have the right permissions for .ssh directory and authorized_keys file, as shown in chmod command above otherwise SSH will not honor your authorized_keys.

 Now you should be able to login to the remote server without typing your password.Type the below command from your local machine.

 ssh hostname -l username  

SSH should log you in without password! Now, you can also scp without having to enter your password.

 

Thanks - Kapil Pant