Auto Start the Xampp in linux

Here are the steps to make the xampp auto start in linux.

Step 1:

Open the ‘Terminal’ and Login as a root user.

Step 2:

Now type the command

$sudo gedit /etc/rc.local

it will open the file in a editor and add the following lines in the last line of the file.

/opt/lampp/lampp start

Keep sharing….

Advertisements

Stopping an another web server deamon in XAMPP

I have been facing a problem with my Xampp Server all time.When ever i start my xampp server, it shows up “Another web server deamon is already running”.

I have been tried uninstalling and reinstalling back , it still shows up with the same message.

So, i have gone back to googling to find a solution for this stop the another web server deamon.

After long time , i have landed up with a solution.

You try stopping that server by a command.

$ sudo /etc/init.d/apache2 stop

Now i have started the Xampp Server.It works pretty fine and good.

Connect Java with MySql

Pre-requisite:

1.Java installed.

2.WAMP(Windows Apache MySql PHP) installed.

Few Steps to Connect your Java Program with your MySql Backend.

Step 1:

Check that your Computer has Java Installed.

Step 2:

Download the MySql Connection for Java.

Step 3:

Put the downloaded JAR(Java Archive File) in to the location where JavaHome/jdkversion/jre/lib/ext ..

Inside to the ext Directory.

Step 4:

Write Java Code to Connect to the MySql Database.

Sample code to connect Java with MySql.

File:jdbc.java

import java.sql.*;
class jdbc
{
public static void main(String ar[])
{
try
{
Class.forName (“com.mysql.jdbc.Driver”);
Connection con=DriverManager.getConnection(“jdbc:mysql://127.0.0.1:3306/databasenamehere”,”root”,””);
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(“select * from tablenamehere”);
while(rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getString(2));
}
}
catch(Exception e)
{
System.out.println(“Error occurerd”);
}
}
}

Step 5:

Compile your Java using javac filename.java.

On the Successful Completion of Java File you will see that the Class file has been created.

Run your Java File using java filename.

You will get Data from the MySql Database.

Feel free to share your comments and your Queries.