User talk:Ymehmood

Set Up SVN-Client(TortiseSVN) ON Window To Connect with Linux Subversion Server
This document assumes subversion is up and running on Linux machine and you have username and password for Linux machine. 1.	Create a repository on Linux machine in your desired directory. For example I will create repository in the following directory (/home/yasir/rep).

command to create repository: Svnadmin create /home/yasir/rep

2.	Now go in rep folder of your newly created repository and you will find conf folder. In conf folder you will find three files. We need to make some changes in svnserv.conf and passwd files.

3.	Open svnserv.conf file and uncomment password-db = passwd by removing # symbol from front of it. This will force svn server to look for username and password in default password file which is passwd.

#password-db = passwd To password-db = passwd

4.	Now open the passwd file and at the end of file in users section create new user. Let say our user name is “admin” and password is “password”. You will add something like admin = password.

5.	Now install TortiseSVN and create a folder where you want to keep your files.

For example I will create c://myProject folder in window.

6.	Go in c://myProject and right click in that folder. You will find SVN Checkout option. Select this option and you will see a new window. Type “svn://machineUserName@machineName/machineIP/Path/To/Repsitory”. I will give one example: My machine name is Yasir-PC and my machine user name is ymehmood

svn://ymehmood@Yasir-PC/home/yasir/rep

Click OK and you will see everything form server will come in to rep folder. Now you can start playing with files.

Postgres DataBase LookUp Through JNDI
-1. Download download jdbc driver for Postgres and place it in lib directory of your Tomcat 6. postgresql-8.0-312.jdbc3.jar. -2. Open context.xml file in conf of Tomcat Directory and Add the following before the   '''  ''' -3. What i have done in above i created a JNDI resource with of type DataSoure and set its parameters. Now Suppose i have a table in my database with name Person and have only two fields fName and lName. I will try to run insert query in this table. '''public void myMethod{ StringBuffer sql = new StringBuffer("INSERT INTO \"Person\"(\"fName\", \"lName\")VALUES (\'a\', \'b\');"); Connection con = null; DataSource ds; try { ds = (DataSource) new InitialContext.lookup("java:/comp/env/jdbc/postgres"); con = ds.getConnection; con.createStatement.execute(sql.toString); con.commit; } catch (Exception ex) { ex.printStackTrace; }     } ''' Now you good to go... Thanks For Reading...

Restore Data Into Postgres From SQL

 * psql -U userName -d database -f file.sql

Move Data From Local Server To Remote Server

 * pg_dump -U userName dbname | psql -U userName -h hostname dbname