JAVA Quick Search Engine :

Custom Search

NB:

You can Find ALL (Downloads,tutorials,meaning,more posts)Quickly and easily With This Search engine.

*For Meaning Use : Meaning of 'WORD' .
*For Download Somthing Use : Downloads ' WORD'
*For More Posts About A Subjet Use : Posts About 'WORD/SENTENSE')

Thursday, April 30, 2009

Update the PATH variable

You can run the Java 2 SDK without setting the PATH variable, or you can optionally set it as a convenience.

Should I set the PATH variable?
Set the PATH variable if you want to be able to conveniently run the Java 2 SDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command. If you don't set the PATH variable, you need to specify the full path to the executable every time you run it, such as:

    C:> \j2sdk1.4.2_\bin\javac MyClass.java 
It's useful to set the PATH permanently so it will persist after rebooting.

How do I set the PATH permanently?
To set the PATH permanently, add the full path of the j2sdk1.4.2_\bin directory to the PATH variable. Typically this full path looks something like C:\j2sdk1.4.2_\bin. Set the PATH as follows, according to whether you are on Microsoft Windows NT or 98/2000/ME.

Microsoft Windows NT, 2000, and XP - To set the PATH permanently:

  1. Choose Start, Settings, Control Panel, and double-click System. On Microsoft Windows NT, select the Environment tab; on Microsoft Windows 2000 select the Advanced tab and then Environment Variables. Look for "Path" in the User Variables and System Variables. If you're not sure where to add the path, add it to the right end of the "Path" in the User Variables. A typical value for PATH is:
         C:\j2sdk1.4.2_\bin
    Capitalization doesn't matter. Click "Set", "OK" or "Apply".

    The PATH can be a series of directories separated by semi-colons (;). Microsoft Windows looks for programs in the PATH directories in order, from left to right. You should only have one bin directory for a Java SDK in the path at a time (those following the first are ignored), so if one is already present, you can update it to j2sdk1.4.2_\bin.

  2. The new path takes effect in each new Command Prompt window you open after setting the PATH variable.

Microsoft Windows 98 - To set the PATH permanently, open the AUTOEXEC.BAT file and add or change the PATH statement as follows:

  1. Start the system editor. Choose "Start", "Run" and enter sysedit, then click OK. The system editor starts up with several windows showing. Go to the window that is displaying AUTOEXEC.BAT

  2. Look for the PATH statement. (If you don't have one, add one.) If you're not sure where to add the path, add it to the right end of the PATH. For example, in the following PATH statement, we have added the bin directory at the right end:

    PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\J2SDK1.4.2_\BIN
    Capitalization doesn't matter. The PATH can be a series of directories separated by semi-colons (;). Microsoft Windows searches for programs in the PATH directories in order, from left to right. You should only have one bin directory for a Java SDK in the path at a time (those following the first are ignored), so if one is already present, you can update it to j2sdk1.4.2_.

  3. To make the path take effect in the current Command Prompt window, execute the following:
          C:> c:\autoexec.bat 
    To find out the current value of your PATH, to see if it took effect, at the command prompt, type:
          C:> path 

Microsoft Windows ME - To set the PATH permanently:

From the start menu, choose programs, accessories, system tools, and system information. This brings up a window titled "Microsoft Help and Support". From here, choose the tools menu, then select the system configuration utility. Click the environment tab, select PATH and press the edit button. Now add the SDK to your path as described in step b above. After you've added the location of the SDK to your PATH, save the changes and reboot your machine when prompted.

YOU CAN USE QUICK SEARCH ENGINE IN THE TOP FOR MORE DOWNLOADS OR DETAILS.


Network Server Options

By default, the Derby Network Server only accepts requests from the localhost on port 1527. You can modify the Network Server to:

For more information about these options, and more, see the Derby Server and Administration Guide.

YOU CAN USE QUICK SEARCH ENGINE IN THE TOP FOR MORE DOWNLOADS OR DETAILS.

Stop Network Server

Stop the Network server by executing the stopNetworkServer.bat (Windows) or stopNetworkServer.ksh (UNIX) script, as shown below:

Windows: C:\> cd %DERBY_INSTALL%\bin C:\Apache\db-derby-10.4.1.3-bin\bin> setNetworkServerCP.bat C:\Apache\db-derby-10.4.1.3-bin\bin> stopNetworkServer.bat

UNIX: $ cd $DERBY_INSTALL/bin $ . setNetworkServerCP.ksh $ stopNetworkServer.ksh

The window running the NetworkServer should output a message confirming the shutdown.

Note that, as with starting the server, there is also an easier way to shut down the server. For example:

Windows: C:\> java -jar %DERBY_INSTALL%\lib\derbyrun.jar server shutdown

UNIX: $ java -jar $DERBY_INSTALL/lib/derbyrun.jar server shutdown

Run derbyrun.jar without arguments for further usage information. derbyrun.jar has been included with Derby releases since the 10.2 release series.


YOU CAN USE QUICK SEARCH ENGINE IN THE TOP FOR MORE DOWNLOADS OR DETAILS.


Get a Network Server Connection

When executed with the derbyclient argument, the SimpleApp application creates and connects to the derbyDB database with this code:

protocol = "jdbc:derby://localhost:1527/"; ... conn = DriverManager.getConnection(protocol + "derbyDB;create=true", props);

That connection URL, fully constructed, looks like this:

jdbc:derby://localhost:1527/derbyDB;create=true

Don't shut Derby down

If you look at the SimpleApp.java code you'll notice that it only shuts Derby down if it's running in embedded mode. When connecting via the Network Server, other applications might be accessing the same database you are; so, don't shut down the databases or Derby.

YOU CAN USE QUICK SEARCH ENGINE IN THE TOP FOR MORE DOWNLOADS OR DETAILS.

Load the Client JDBC Driver

When executed with the derbyclient argument, the SimpleApp application loads the Derby Network Client driver with this code:

driver = "org.apache.derby.jdbc.ClientDriver"; ... Class.forName(driver).newInstance();


YOU CAN USE QUICK SEARCH ENGINE IN THE TOP FOR MORE DOWNLOADS OR DETAILS.


Test network server connection

An embedded connection URL that creates and connects to a database looks like this:

java org.apache.derby.tools.ij ij> connect 'jdbc:derby:MyDbTest;create=true';

A Derby Network Client connection URL is very close; just add //localhost:1527/ before the database name:

java org.apache.derby.tools.ij ij> connect 'jdbc:derby://localhost:1527/MyDbTest;create=true';

What is the physical location of the newly created database?

If you use the embedded driver, by default the database is created in the same directory in which ij was started up. If you use the Derby Network Client JDBC driver, by default the database is created in the directory where the Network Server was started up; in other words, in DERBY_INSTALL/bin.

Derby provides many ways to specify the actual location. For example, the connection URL below specifies a full path for the database location:

java org.apache.derby.tools.ij ij> connect 'jdbc:derby://localhost:1527//home/bill/DerbyDb/MyDbTest;create=true';

YOU CAN USE QUICK SEARCH ENGINE IN THE TOP FOR MORE DOWNLOADS OR DETAILS.


Configure environment to use Derby Network Client JDBC driver

To use the Derby Network Client JDBC driver, set your CLASSPATH to include the jar files listed below:

  • derbyclient.jar: contains the JDBC driver
  • derbytools.jar: optional, provides the ij tool

You can set your CLASSPATH explicitly with the command shown below:

Windows: C:\> set CLASSPATH=%DERBY_INSTALL%\lib\derbyclient.jar;%DERBY_INSTALL%\lib\derbytools.jar;.

UNIX: $ export CLASSPATH=$DERBY_INSTALL/lib/derbyclient.jar:$DERBY_INSTALL/lib/derbytools.jar:.

You can also use the script that the Derby software distribution provides to set CLASSPATH. Change directory to the DERBY_INSTALL/bin directory, then execute the setNetworkClientCP.bat (Windows) or setNetworkClientCP.ksh (UNIX) script as shown below:

Windows: C:\Apache\db-derby-10.4.1.3-bin\bin> setNetworkClientCP.bat

UNIX: $ . setNetworkClientCP.ksh

YOU CAN USE QUICK SEARCH ENGINE IN THE TOP FOR MORE DOWNLOADS OR DETAILS.