March 2007

You are currently browsing the monthly archive for March 2007.

Just found a book introduction from TheServerSide.com

This book explains the concept of JPA, with some useful knowledge on the persistence standard, JPA Annotations, Entity Manager and JPA Query Language (also known as EJB-QL), etc. There are examples, and a simple Maven 2 application with MySQL Database, and Hibernate as the persistence provider will be build after reading through the book. I hope this will be useful for my development using JPA.

Post on TheServerSide
JPA101 Chapter
Author: Chris Maki’s Blog
http://jroller.com/page/cmaki

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • Technorati
  • YahooMyWeb

I want to import data in an Excel file into MySQL table. MySQL tools like MySQL Query Browser does not provide such function. There are sharewares on the web which provide this function. Instead, you can use function that already provided by MySQL, easy and quick solution.

First, you need to export the data to csv file. Remove any csv headers from the file. After that, run the following script in MySQL Console:

load data local infile 'uniq.csv' into table tblUniq

fields terminated by ','

enclosed by '"'

lines terminated by '\r\n'

(uniqName, uniqCity, uniqComments)

This script loads the file uniq.csv from the local file directory, and imports to table tblUniq. It tokenized the field by terminator, and enclosed all fields with specified character.

In using this script, you need to take care of the special characters in the fields. When exporting csv, if one of the fields got a comma, this field will be enclosed by ” as well. It will cause conflict with the above script. So, to solve this, put your csv file into a Text editor and do some customization before using the script. For example, use “|” instead of “,” for the terminator, etc.

Reference here

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • Technorati
  • YahooMyWeb

« Older entries

 

March 2007
S M T W T F S
« Feb   May »
 123
45678910
11121314151617
18192021222324
25262728293031

Categories