Archive

Posts Tagged ‘codes’

IBM – TGMC Eclipse, DB2 and Websphere

October 4, 2010 73 comments

Our team took nearly 3 weeks to start implementation, which is actually not required and I do not want other starters to waste so much time. So here is a PPT file which help starters. Work Guide for tgmc

UPDATE 1(15th Nov 2010) : Here is another pdf which might be helpful, check that too. Config_WASCE_Eclipse

UPDATE 2(19th feb 2011) : The slide number 104 in the ppt ( work guide for tgmc1 ) shows the selection of only one driver. Please make a correction that you need to select following two drivers instead of just one.
1. ‘com.ibm.db2/db2jcc/9.1/jar’
2. ‘com.ibm.db2/db2jcc_license_cu/9.1/jar’
The selection of the second driver type is missing in the ppt. You can select both the drivers simultaneously by pressing control button.

NOTE : The slide number 104 in the ppt shows the selection of driver version 8.1, but you can either choose driver version 8.1 or 9.1 . This depends on the DB2 version you are using.

I would suggest to read few articles on:

1. JDBC and types of JDBC drivers available.

2. Connection Pool

3. Recordset

This gives you a better idea and understanding when you are configuring.

I have also seen most of the team struggling for the JDBC test code. So below is the sample JDBC code which can be used for testing the JDBC :-

import java.sql.*;
public class connect {
public static void main(String[ ] args)
{
try
{
Class.forName( “com.ibm.db2.jcc.DB2Driver” );
Connection con = DriverManager.getConnection( “jdbc:db2://localhost:50000/testdb”, “db2admin”, “db2_pass” );
Statement statement = con.createStatement( );
ResultSet rs = statement.executeQuery(“select * from db2admin.db2_test_table”);
while ( rs.next( ) )
{
String firstname = rs.getString( “FIRSTNME” );
String lastname = rs.getString( “LASTNAME” );
System.out.println(“FirstName: “+firstname+”, Lastname: “+lastname);
}
statement.close( );
con.close( );
}
catch( Exception e )
{
e.printStackTrace( ); }
}
}
}

Following things to remember :-
1. In the above example in line no 8, the password has to be replaced with the one you choose. The password in the above example is “db2_pass“.

2. You need to change the table details also. The table schema used in above example is

db2_test_table(FIRSTNAME varchar(20), LASTNAME varchar(20)).

hope this helps.All the best. :)

NOTE : Both PPT and PDF tutorials found in this blog post are not designed by me and I too have got it from the web long ago. It is only for the purpose of sharing information with the world, so that, everyone can be benefited.

interested in coding…….

Here is the link for all the people those who want to participate in coding contest.You can also solve coding question published by this site……

click on http://www.topcoder.com/

I will keep posting the question which i select and solve.check the category coding for questions……The programming language i use is C++………

Categories: Algos, Miscellaneous Tags:

Kernel Recompilation

May 22, 2009 4 comments

U guys wanna recompile linux kernel then do this…. go http://kernel.org and download the stable kernel file.The site using which i downloaded the kernel is http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.3.tar.bz2

I have downloaded kernel version linux-2.6.29.3 and i have recompiled this version.Your version may differ from  mine,so be careful about that……

Before starting with anything,(it is better to be a root and then proceed) u might need to install few supporting libraries,for that use command

#aptitude install build-essential automake autoconf zlib1g-dev libdb4.4-dev libboost-dev  libboost-serialization-dev libncurses-dev

automake and autoconf are used for the command makefile,confile etc…

libncurese-dev is used for menucofig and so on…

These libraries direct the newly created file in their proper place so that user does not need to direct them manually……

Now,follow the steps:-

1.after downloading, the file will be  linux-2.6.29.3.tar.bz2.This file has to be copied to the location /usr/src

After copying Unpack it.follow the commands

#cd /usr/src

#tar xjf linux-2.6.29.3

now make a symbolic link to the folder linux using this comman

#ln -s linux-2.6.29.3 linux

Read more…

Follow

Get every new post delivered to your Inbox.