Monday, November 25, 2019

Creating a eclips project.

Download the jdbc connector from mysql website.

Copy to project folder and set the CLASSPATH.


Source codes:
mysql> SHOW DATABASES;

mysql> CREATE DATABASE employees;

mysql> USE employees;


CREATE TABLE IF NOT EXISTS emp (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    age TINYINT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)  ENGINE=INNODB;


mysql> SELECT * FROM emp;

mysql> DESCRIBE emp;

mysql> SHOW TABLES;

mysql> INSERT INTO emp(name, age) VALUES('Fahad', 18);

mysql> exit


Java Source Code:
https://bdjunayed.visualstudio.com/SampleJFrameExample

Friday, November 22, 2019

MySQL connection with Jdbc Java 12 - 13 and insert in to table

First download the driver, then make a tables and download the xammp for the mysql server 5.7.

Video links:

Video link Basic: 

Source codes:
mysql> SHOW DATABASES;

mysql> CREATE DATABASE employees;

mysql> USE employees;


CREATE TABLE IF NOT EXISTS emp (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    age TINYINT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)  ENGINE=INNODB;


mysql> SELECT * FROM emp;

mysql> DESCRIBE emp;

mysql> SHOW TABLES;

mysql> INSERT INTO emp(name, age) VALUES('Fahad', 18);


mysql> exit




Java Codes:
package com.microtech;
import java.sql.*;

public class AnotherTest {

public static void main(String[] args) {
// TODO Auto-generated method stub
try { Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/employees?serverTimezone=UTC", "root", ""); PreparedStatement st = conn.prepareStatement("INSERT INTO emp(name, age) VALUES(?, ?);"); st.setString(1, "Junayed"); st.setShort(2, (short) 12); boolean resultSet = st.execute(); if (!resultSet) System.out.println("Data inserted successfully!"); else System.out.println("Try again!"); } catch(Exception e) { System.out.println("My exception: " + e); } System.out.print("End of the execution!");

}
}

Monday, November 18, 2019

AWS CLI2: install and config on ubuntu 18

Require: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html

Installation on ubuntu:



Saturday, November 9, 2019

Create a bootable USB flash drive

Performed system configuration:
250GB HDD
HP Pavilion Laptop with windows 10 running.


Ruru's configuration details:

Tools configuration:
Boot directly from restart with a UBS3
Bios settings
Rufu Format settings
Result
Legacy
GTP
OK
Legacy
MBR
Format fails
Legacy disabled
GTP
Boot fails
Legacy disabled
MBR
Format fails

Boot directly from restart with a UBS2
Bios settings
Rufu Format settings
Result
Legacy
MBR
Format fails







Boot from windows settings with USB3 (UEFI)
Rufu format: GTP
Result: OK