Skip to content

Instantly share code, notes, and snippets.

View behitek's full-sized avatar
😎

Hieu Nguyen Van behitek

😎
View GitHub Profile
@behitek
behitek / ReadWriteExcelFile.java
Last active October 30, 2018 05:05 — forked from madan712/ReadWriteExcelFile.java
Đọc ghi file Excel trong Java sử dụng Apache POI
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@behitek
behitek / TEST.md
Last active January 4, 2017 16:22
Hiếu Nguyễn
@behitek
behitek / Caro.java
Last active June 6, 2023 02:53
Game Caro Code Java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package test;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
@behitek
behitek / ME.MD
Last active December 24, 2016 10:32

Cập nhật số lượng sách khi thay đổi trên tb_CTPN

1

ALTER TRIGGER [dbo].[tg_DeleteCTPN]
   ON  [dbo].[tb_CTPN]
   For delete
AS 
BEGIN
	Declare @soLuong int
@behitek
behitek / ReadWrite_jtableVsExcel.MD
Last active December 15, 2016 16:32
Read Write jTable - Excel in java swing using POI

Xuất jTable sang file Excel

Hàm thực thi đọc dữ liệu từ jTable vào file Excel

public static void toExcel(JTable table, File file) throws IOException {
        String sheetName = "Sheet1";//name of sheet
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet(sheetName);
        TableModel model = table.getModel();
        //Get colum name
 HSSFRow row = sheet.createRow(0);
@behitek
behitek / Real_Time.java
Created December 15, 2016 12:20
Real Time In swing to a label
public class PlaySchoolClock {
public static void main(String[] args) {
new PlaySchoolClock();
}
public PlaySchoolClock() {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
#include <stdio.h>
#include <string.h>
void nhap(char c[]){
char ch;
int i = 0;
do{
scanf("%c",&ch);
if(ch != 'k'){
c[i] = ch;
#include <stdio.h>
#include <conio.h>
void nhapMang (int a[],int n){
for(int i = 0;i < n;i++){
scanf("%d",&a[i]);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package bookstore.DAL;
import bookstore.Entity.NhaXuatBan;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
package learn;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class mySqlConnect{
protected Connection con = null;
protected Statement stm = null;