跳到主要內容

發表文章

目前顯示的是 十二月, 2011的文章

Hibernate c3p0 pool

在Hibernate中使用Connection Pool來增強與資料庫連線的穩定度...<!-- configuration pool via c3p0 --><propertyname="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property><propertyname="c3p0.min_size">0</property><propertyname="c3p0.max_size">30</property><propertyname="c3p0.timeout">600</property><propertyname="c3p0.max_statements">0</property><propertyname="c3p0.acquire_increment">1</property><propertyname="c3p0.idle_test_period">60</property>

MS SQL import SQL file

兩種從MSSQL執行外部檔案的方式:

1. Execute file from SQL Tool
-- To allow advanced options to be changed. EXEC sp_configure 'show advanced options', 1 GO -- To update the currently configured value for advanced options. RECONFIGURE GO -- To enable the feature. EXEC sp_configure 'xp_cmdshell', 1 GO -- To update the currently configured value for this feature. RECONFIGURE GOEXEC master..xp_cmdshell  'c:\Scripts\create_db.sql'2. Execute file from CMD ToolSQLCMD -E -d master -i c:\Scripts\create_db.sql

MySQL select to file

兩種儲存MySQL資料到檔案的方法 Piping the SQL into the databaseecho "SELECT * FROM TABLE_NAME" | mysql -uUSERNAME -pPASSWORD DATABASENAME > /tmp/outfile.txt; 

Using an external SQL file.mysql -uUSERNAME -pPASSWORD DATABASENAME < /tmp/sql.sql > /tmp/outfile.txt;