find ./ -name '*.txt'


출처:http://ysoftman.blogspot.kr/2010/11/linux-find-paths-must-precede-expression.html


이름에 *TBL* 인 파일 모두 지우기

D:\tmp>for /r %i in (*TBL*) do del %i



#!/usr/bin/perl

#use Mysql;

use DBI;

use DBD::mysql;


# CONFIG VARIABLES

$platform = "mysql";

$database = "MYDATABASE";

$host = "localhost";

$port = "3306";

$user = "MYUSER";

$pw =   "MYPASSWORD";


# DATA SOURCE NAME

$dsn = "dbi:mysql:$database:$host:$port";


# PERL DBI CONNECT

$connect = DBI->connect($dsn, $user, $pw);


fetch_db("MYTABLE");


sub fetch_db() {

my($table) = @_;

my $file = $table . ".txt";


open($FH, ">$file") or die("Can't open : $file $!\n");


print "테이블  $table\n";

print $FH "테이블  $table\n";


get_count($table);



print $FH "\n";

print "\n";


print $FH "---END--\n";

close $FH;



}


sub get_count() {


my($table) = @_;

# PREPARE THE QUERY

$query = "select TYPE, CAST(STORE_ID AS UNSIGNED INTEGER), count(*) from $table group by TYPE, CAST(STORE_ID AS UNSIGNED INTEGER)";

$query_handle = $connect->prepare($query);

# EXECUTE THE QUERY

$query_handle->execute();

# BIND TABLE COLUMNS TO VARIABLES

$query_handle->bind_columns(undef, \$id, \$type, \$cnt);

print "* 샵 별 건수\n";

print $FH  "* 샵 별 건수\n";

# LOOP THROUGH RESULTS

print "TYPE\tSHOP_ID\tCNT\n";

print $FH "TYPE\tSHOP_ID\tCNT\n";

print "-------\t----\t---\n";

print $FH "-------\t----\t---\n";

while($query_handle->fetch()) {

  print "$id\t$type\t$cnt\n";

  print $FH "$id\t$type\t$cnt\n";



alter table MYTABLE add primary key ( MYID );

alter table MYTABLE add index  MYCOL ( MYCOL );

show index from MYTABLE;


참고: http://www.webmadang.net/database/database.do?action=read&boardid=4003&page=2&seq=10


출처:http://stackoverflow.com/questions/1887964/duplicate-entire-mysql-database


CREATE DATABASE duplicateddb;

 mysqldump -u admin -p originaldb | mysql -u backup -pPassword duplicateddb; 


mysqldump --no-data  -uUSERID -pPASSWORD -h HOST DB > dbschema.dump


* 출처:http://stackoverflow.com/questions/4486787/jackson-with-json-unrecognized-field-not-marked-as-ignorable

import org.codehaus.jackson.map.ObjectMapper;


public class TestObjectmapper implements SubJobRunner { 


public static void main(String[] args) {

//    String jsonStr = "{\"wrapper\"\:[{\"id\":\"13\",\"name\":\"Fred\"}]}";

   String jsonStr = "{}";

   ObjectMapper mapper = new ObjectMapper();  

   Wrapper wrapper = null;

   try {

       wrapper =         mapper.readValue(jsonStr , Wrapper.class);

   } catch (Exception e) {

       e.printStackTrace();

   }

   System.out.println("111111111111111");

   System.out.println("wrapper = " + wrapper);

   System.out.println("222222222222222222");

}

public class Student { 

   private String name;

   private String id;

   //getters & setters for name & id here

}

public class Wrapper {

   private List<Student> students;

   //getters & setters here

}

}


http://stackoverflow.com/questions/16987543/how-to-fix-org-codehaus-jackson-map-exc-unrecognizedpropertyexception


회원 가입 후 임시 사용할 수 있다.

http://www.objectaid.com/install-license

eclipse 등록 방법 : windows -> preferences -> objectaid -> add



출처:http://stackoverflow.com/questions/3613704/mysql-show-current-connection-info


mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.5.8, for Win32 (x86)

Connection id:          1
Current database:       test
Current user:           ODBC@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.5.8 MySQL Community Server (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    gbk
Conn.  characterset:    gbk
TCP port:               3306
Uptime:                 7 min 16 sec

Threads: 1  Questions: 21  Slow queries: 0  Opens: 33  Flush tables: 1  Open tables: 26  Queries per second avg: 0.48
--------------

mysql>