Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/default-filters.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/default-filters.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/class-wp-theme.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/class-wp-theme.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/class-wp-styles.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/class-wp-styles.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/class-wp-rest-request.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/class-wp-rest-request.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/block-supports/duotone.php on line 1

Warning: Uninitialized string offset 0 in /home/ujjal/public_html/blog/wp-includes/block-supports/duotone.php on line 1

Warning: Cannot modify header information - headers already sent by (output started at /home/ujjal/public_html/blog/wp-includes/default-filters.php:1) in /home/ujjal/public_html/blog/wp-includes/feed-rss2.php on line 8
জাভা – Diary of Ujjal https://blog.ujjal.net Software Development Lead, Very good listener, Tech enthusiastic, Movie & Series freak Sat, 14 Feb 2015 10:38:34 +0000 en-US hourly 1 https://wordpress.org/?v=6.2.6 Review of basic Java Standard Edition (আস্তে আস্তে জাভা শিখি) https://blog.ujjal.net/?p=259&utm_source=rss&utm_medium=rss&utm_campaign=review-of-basic-java-standard-edition-%25e0%25a6%2586%25e0%25a6%25b8%25e0%25a7%258d%25e0%25a6%25a4%25e0%25a7%2587-%25e0%25a6%2586%25e0%25a6%25b8%25e0%25a7%258d%25e0%25a6%25a4%25e0%25a7%2587-%25e0%25a6%259c%25e0%25a6%25be%25e0%25a6%25ad%25e0%25a6%25be-%25e0%25a6%25b6%25e0%25a6%25bf%25e0%25a6%2596 https://blog.ujjal.net/?p=259#respond Wed, 15 Jan 2014 17:02:32 +0000 http://ujjalruet.wordpress.com/?p=259 Continue reading "Review of basic Java Standard Edition (আস্তে আস্তে জাভা শিখি)"

]]>
Here is a list of basics about Java what we must know.

  • Code Structure
    [public static void main(String a[]) , class name]
  • Difference between C, C++ and JAVA
  • Why Java is better than other programming languages?
  • What do you mean by OOP?
  • Does Java supports OOP?
  • Define these terms
    • inheritence
    • encapsulation
    • polymorphism
  • Access Specifiers
  • Friend function
  • Friend Class
  • Super class, Sub class
  • Difference between abstract class and interface
  • implement or extend
  • Virtual class, virtual function
  • Differences between Function Overloading & Operator overloading
  • String Manipulation

As per my knowledge, If we learn these things with practicing some code related to these topics, we can start for any kind of development or to take in part in java related exams.

I am sorry to say that I can’t share these things right now. But in near future, a brief of these topics will be here.

[polldaddy poll=7717806]

]]>
https://blog.ujjal.net/?feed=rss2&p=259 0
Creating AutoBack Up of MySQL Database using JAVA OR PHP ( পিএচপি অথবা জাভা তে কিভাবে মাইএসকিউএল ডাটাবেজ এর অটোমেটিক ব্যাকআপ করতে হয় ) https://blog.ujjal.net/?p=170&utm_source=rss&utm_medium=rss&utm_campaign=creating-autoback-up-of-database-using-java https://blog.ujjal.net/?p=170#comments Wed, 02 May 2012 15:35:55 +0000 http://ujjalruet.wordpress.com/?p=170 Continue reading "Creating AutoBack Up of MySQL Database using JAVA OR PHP ( পিএচপি অথবা জাভা তে কিভাবে মাইএসকিউএল ডাটাবেজ এর অটোমেটিক ব্যাকআপ করতে হয় )"

]]>
It is usual that we need to backup the database in software development (specially in Enterprise Software,web applications ) Database is very important which contains all the information about the organization. Last night I have coded a auto backup script in both JAVA and PHP. Here I am gonna post them below with comment.

Code Written in JAVA

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.*;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author Ujjal Suttra Dhar
 */

class create_backup{

    String database = "your_database_name",  user = "root", password = "pass";
    Connection m_Connection = null;
    Statement m_Statement = null;
    ResultSet m_ResultSet;
    String m_Driver = "com.mysql.jdbc.Driver";
    String m_Url = "jdbc:mysql://localhost:3306/" + database;

    public create_backup(){

        /*Eshtablishment of Connection of java code with MySQL using JDBC
         You must read my previous post to know further about this. 
         */
        try {
            Class.forName(m_Driver);
            m_Connection = DriverManager.getConnection(m_Url, user, password);
            //Create Statement object
            m_Statement = m_Connection.createStatement();

        } catch (Exception ex) {
            ex.printStackTrace();
        }

        try {
            //Database will be stored in filename.sql which can be import on MySQl as backup
            BufferedWriter  out = new BufferedWriter(new FileWriter("kernel_school.sql"));


            //Now here is the informations about the database of which backup will be created
            String dump = "C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump " //Path to mysql
                    + "--host=localhost" //Mysql hostname
                    + "--port=3306" //Mysql portnumber
                    + "--user=root" //Mysql username
                    + "--password=pass" //Mysql password
                    + "--add-drop-table" //Add a DROP TABLE statement before each CREATE TABLE statement
                    + "--add-drop-database" //Add a DROP DATABASE statement before each CREATE DATABASE statement
                    + "--complete-insert" //Use complete INSERT statements that include column names.
                    + "--extended-insert" //Use multiple-row INSERT syntax that include several VALUES lists
                    + "kernel_school";                  //Mysql databasename


            //executing the command through process.
            Process run = Runtime.getRuntime().exec(dump);


            /*resultant SQL informations are here on the br which can be read line by line .
            And at the same time it will be written on another sql file.*/
            InputStream in = run.getInputStream();
            InputStreamReader isr = new InputStreamReader(in);
            BufferedReader br = new BufferedReader(isr);
            String line = null;

            while ((line = br.readLine())!=null) {
                 out.write(line);
                 out.newLine();
            }

       out.flush(); // must flush or close the file after completing the task.
        // int exitVal = run.waitFor();//when exitVal is ,then the process is completed

        } catch (Throwable t) {
            t.printStackTrace();
      }

    }//constructor
 } // class



public class autobackup {
    public static void main(String a[]){
            new create_backup();
    }
}

Code Written in PHP

]]>
https://blog.ujjal.net/?feed=rss2&p=170 2