Skip to content

Instantly share code, notes, and snippets.

View Dwiga's full-sized avatar

Dwi Ahmad Dwiga

View GitHub Profile
@Dwiga
Dwiga / mycon.py
Created December 27, 2017 11:53
jython connection to mysql
import sys
import os
sys.path.append(os.path.dirname(os.path.realpath('__file__')) + "/python")
from com.ziclix.python.sql import zxJDBC
cnx = zxJDBC.connect("jdbc:mysql://localhost/yourdb", "username", "password", "org.gjt.mm.mysql.Driver")
public dft_teman() {
initComponents();
btnAct.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String isi = plcTxt.getText();
System.out.println(isi);
}
private void btnProcessMouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
int strUsia = Integer.parseInt(txtUsia.getText());
int thnLahir = 2017-strUsia;
String a = "Nama saya" + txtNama.getText()+ ", Saya biasa di panggil " + txtNickname.getText() + ", Alamat saya " + txtAlamat.getText() + ", nomor hp saya " + txtNohp.getText() + ""
+ " dan lahir pada tahun " + thnLahir;
plcTxt.setText(a);
}
/*
* 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 digital_scale;
/**
*
* @author riyos
import tkinter
from tkinter import *
from sqlite import con, exe
con = con
exe = exe
import datetime
head = tkinter.Tk()
Label(ndas, text="Title").grid(row=0)
@Dwiga
Dwiga / sqlite.py
Last active May 3, 2017 15:28
SQLite connect
import sqlite3
con = sqlite3.connect("alpha.db")
exe = con.cursor()
@Dwiga
Dwiga / mysqlcon.py
Created April 25, 2017 11:40
python connection
import pymysql
db = pymysql.connect(host="localhost", user="root", passwd="psswrd", db="movie")
kusi = db.cursor()
@Dwiga
Dwiga / kon.py
Created April 25, 2017 11:18
python connection to sqllite and mysql
import sqlite3
import pymysql
"""sqlite"""
con = sqlite3.connect("alpha.db")
exe = con.cursor()
"""MySQL"""
db = pymysql.connect(host="localhost", user="root", passwd="psswrd", db="movie")
kusi = db.cursor()