Skip to content

Instantly share code, notes, and snippets.

@rohman
rohman / odbc_con.php
Created April 17, 2013 23:17
PHP ODBC Connection
<?php
$host = '127.0.0.1'; // ini merupakan hostnya
$db = 'databasenya';
$user = 'sa'; // user sql server
$pwd = 'sa'; // password sql server
//$dsn = "Driver={SQL Native Client};Server=$host;Database=$db; Uid=$user;Pwd=$pwd;";
// This is a more generic one I use with to dev with, Windows 7 and SQL Server 2008
$dsn = "Driver={SQL Server};Server=$host;Database=$db; Uid=$user;Pwd=$pwd;"; // only for dev. purposes
try{
@rohman
rohman / tamu_cari.php
Created April 16, 2013 10:23
Belajar TypeHead Bootstrap CI
<!DOCTYPE html>
<html lang="en">
<head>
<title>..:: Buku Tamu ::..</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="<?php echo $this->config->item('assets_url');?>css/bootstrap.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/bootstrap.js"></script>
<script type="text/javascript">
@rohman
rohman / tamu_model.php
Created April 16, 2013 10:21
Belajar TypeHead Bootstrap CI
<?php
class Tamu_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
function cariTamu($namaTamu, $limit)
{
@rohman
rohman / Tamu.php
Created April 16, 2013 10:20
Belajar TypeHead Bootstrap CI
<?php
class Tamu extends CI_Controller
{
public $data;
function __construct()
{
parent::__construct();
}
@rohman
rohman / UlangSpringservice.java
Created April 11, 2013 23:47
Ulang Spring mvc Service MainClass
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ulang.springservice;
import id.web.rohman.ulangspringservice.model.Tamu;
import id.web.rohman.ulangspringservice.service.api.TamuService;
import java.sql.Connection;
import java.sql.SQLException;
@rohman
rohman / TamuServiceImpl.java
Created April 11, 2013 23:45
Ulang Spring mvc Service
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package id.web.rohman.ulangspringservice.service.impl;
import id.web.rohman.ulangspringservice.model.Tamu;
import id.web.rohman.ulangspringservice.service.api.TamuService;
import java.util.List;
import org.hibernate.SessionFactory;
@rohman
rohman / TamuService.java
Created April 11, 2013 23:44
Ulang Spring mvc Service
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package id.web.rohman.ulangspringservice.service.api;
import id.web.rohman.ulangspringservice.model.Tamu;
import java.util.List;
/**
@rohman
rohman / Tamu.java
Created April 11, 2013 23:43
Ulang Spring mvc Service
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package id.web.rohman.ulangspringservice.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@rohman
rohman / jdbc.properties
Created April 11, 2013 23:42
Ulang Spring mvc Service
# To change this template, choose Tools | Templates
# and open the template in the editor.
hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
jdbc.driver = com.mysql.jdbc.Driver
jdbc.url = jdbc:mysql://localhost/belajar?zeroDateTimeBehavior=convertToNull
jdbc.username = belajar
jdbc.password = belajar
@rohman
rohman / hibernate.cfg.xml
Created April 11, 2013 23:41
Ulang Spring mvc Service
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQL5InnoDBDialect
</property>
<mapping class="id.web.rohman.ulangspringservice.model.Tamu" />