發表文章

How to logmein to Computer without User Password Set

How do I create/remove an Access Code? LogMeIn requires the use of a password.  If you do not have one, you can create one.  In order to do this, you should be physically sitting at the computer where LogMeIn is installed. How do I create an Access Code (LogMeInRemoteUser)? Open the Run box by holding down the Windows logo key and pressing the letter 'R' on your keyboard. Type the following: On Windows XP, Vista, 7: control userpasswords2 . On Windows 2000: control userpasswords . The Windows User Accounts screen appears. Click the Add button. In the user name box, type exactly: LogMeInRemoteUser   and click Next . In the password screen set a password that is at least 8 characters long, keep in mind that it is case sensitive.  This password will be the Access Code.  Select Next . You will be asked "What Level of Access do you want to Grant this User?"  Select Other and make sure the word Administrator is select...

Check the host is down or unknow by InetAddress

getByName public static InetAddress getByName ( String  host) throws UnknownHostException Determines the IP address of a host, given the host's name. The host name can either be a machine name, such as " java.sun.com ", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked. For host specified in literal IPv6 address, either the form defined in RFC 2732 or the literal IPv6 address format defined in RFC 2373 is accepted. If the host is null then an InetAddress representing an address of the loopback interface is returned. See RFC 3330 section 2 and RFC 2373 section 2.5.3. Parameters: host - the specified host, or null . Returns: an IP address for the given host name. Throws: UnknownHostException - if no IP address for the host could be found. SecurityException - if a security manager exists ...

POI reading password protected excel file

The ways to read Excel 2003(xls) and Excel 2007(xlsx) files are different . 1 2003(xls)   Please use the Biff8EncryptionKey Class to specify the password,and POI can automatically validate whether the specied password is right. and open the excel file.  Example (code)     POIFSFileSystem pois = new POIFSFileSystem (new FileInputStream("test.xls"));     Biff8EncryptionKey .setCurrentUserPassword("password");     HSSFWorkbook book = new HSSFWorkbook( pois );  The method of setCurrentUserPassword is thread safe. 2 2007(xlsx)   The difference with 2007's way is that password validate is not automatical,  Example (code) ->  the Junit test code from POI source package (DecryptorTest.java)     POIFSFileSystem fs = new POIFSFileSystem ( POIDataSamples .getPOIFSInstance().openResourceAsStream("protect.xlsx"));         EncryptionInfo info = new EncryptionInfo(fs);     ...

Debug EdtFTP

Debug Edf FTP library by : Add -Dedtftp.log.level=DEBUG for the system properties. Add Logger.setLevel(Level.DEBUG); in the source code.

Optimizing the EclipseLink Application (ELUG)

Reference: http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_%28ELUG%29

SQL Developer 3 - Connecting to SQL Server Using Third Party Drivers

Here's a Quick How To Connect SQL Devleoper 3 to SQL Server or MySQL Note that you can use "Check For Updates" to locate the available drivers. Click Help->Check For Updates Then check the boxes to enable Oracle Extensions and Third Party SQL Devleoper Extensions In the list scroll down to JTDS JDBC Driver 11.1.58.17 or directly download the JTDS JDBC Driver Restart SQL Developer  And then Click Tools->Preferences->Database->Third Party Drivers Add the JTDS driver. Now if you get a message that says java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. You are missing a DLL. Go to SourceForge and download jtds-version-dist.zip and find the missing DLL called ntlmauth.dll Put that anywhere in your path and restart SQL Developer.

EclipseLink How to Configure Primary Key Generation

Using Sequence Objects When using a database that supports sequence objects (such as Oracle Database), EclipseLink can use a database sequence object to automatically generate identifiers for your persistent objects. Using A Default Sequence EclipseLink can produce a default sequence during schema generation. If you use schema generation, then specify that your identifier should be generated and that the SEQUENCE strategy be used to perform the generation. In the following example, the @GeneratedValue annotation indicates that the identifier value should be automatically generated; a strategy of SEQUENCE indicates that a database sequence should be used to generate the identifier. EclipseLink will create a default sequence object during schema generation that will be used at run time. @ Entity public class Inventory implements Serializable {   @Id @GeneratedValue ( strategy=GenerationType. SEQUENCE ) private long id; ...