View RSS Feed

All Blog Entries

  1. Introduction to naming services

    by , 07-07-2012 at 03:58 PM
    Generic naming service organization has been decpicted in the following figure:

    Name:  1.jpg
Views: 607
Size:  24.1 KB

    A generic naming service


    Set of bindings are maintained by the naming service. Names are related by the bindings to the objects. In a naming system, all the objects are named similarly. Naming service is used by the client so that the objects could be located by names.

    Many naming services are present among which few of them will ...
    Categories
    Tutorial
  2. What is JNDI?

    by , 07-07-2012 at 03:53 PM
    To access various naming or directory services, JNDI or Java Naming and directory interface is used that is basically an application programming interface (API). Java Naming and directory interfacen is not considered specified to some specific naming/directory service. Various system could be accessed by it which include file systems; Java RMI, EJB, distributed object system & directory services for example NIS+, Novell NetWare and LDAP.

    JNDI and JDBC are same because both of ...
    Tags: jndi Add / Edit Tags
    Categories
    Tutorial
  3. Windows Screen Grabber JNA methods that I'm working on

    by , 05-26-2012 at 05:50 AM
    This of course requires JNA jar files, platform.jar and jna.jar. The ultimate goal of this code is to create a "bot" that can control a work program. Since the work program uses a Citrix client to interact with the user, if the controller program resides on the client it is impossible to get the program state through the usual methods, and instead I will be required to check for changes in the program display to obtain this information. This code is far from done, but does show some ways ...

    Updated 05-26-2012 at 05:56 AM by Fubarable

    Tags: -1' Add / Edit Tags
    Categories
    Uncategorized
  4. My Goal

    by , 05-20-2012 at 07:30 AM
    Some people on this site may not like how I am posting on this site and for that I am sorry. I am not very good at forums, but my goal not with just this site but with my career in computer science using networking is the follow that I have typed out...

    I want to go all the way down the Networking programming rabbit hole, I want to learn everything I can about computer science, programming, and the world inside of the internet. I have choose Java to do this because I like the syntax ...
    Categories
    Uncategorized
  5. Get the info of a socket

    by , 05-16-2012 at 12:50 AM
    This program reads a list of hostnames from the command-line, attempts to open a socket to each host, and then prints to the remote host, the remote port, and the local address, and the local port.

    ** Happy Coding**

    /* SocketInfo.java
    * Get the info of a socket
    */
    import java.net.*;
    import java.io.*;
    public class SocketInfo{
    public static void main(String[] args){
    for(int index=0; index<args.length; index++){ ...
  6. Using Variables to parameterise tests

    by , 04-27-2012 at 07:29 PM
    Variables don't have to vary - they can be defined once, and if left alone, will not change value. So you can use them as short-hand for expressions that appear frequently in a test plan. Or for items which are constant during a run, but which may vary between runs. For example, the name of a host, or the number of threads in a thread group.

    When deciding how to structure a Test Plan, make a note of which items are constant for the run, but which may change between runs. Decide on ...
    Categories
    Tutorial
  7. Properties and Variables

    by , 04-27-2012 at 07:29 PM
    JMeter properties are defined in jmeter.properties. Properties are global to jmeter, and are mostly used to define some of the defaults JMeter uses. For example the property remote_hosts defines the servers that JMeter will try to run remotely. Properties can be referenced in test plans.

    JMeter variables are local to each thread. The values may be the same for each thread, or they may be different.
    If a variable is updated by a thread, only the thread copy of the variable ...
    Categories
    Tutorial
  8. JMeter Assertions

    by , 04-27-2012 at 07:28 PM
    Assertions allow you to assert facts about responses received from the server being tested. Using an assertion, you can essentially "test" that your application is returning the results you expect it to.
    For instance, you can assert that the response to a query will contain some particular text. The text you specify can be a Perl-style regular expression, and you can indicate that the response is to contain the text, or that it should match the whole response.

    You ...
    Categories
    Tutorial
  9. JMeter Timers

    by , 04-27-2012 at 07:27 PM
    By default, a JMeter thread sends requests without pausing between each request. We recommend that you specify a delay by adding one of the available timers to your Thread Group. If you do not add a delay, JMeter could overwhelm your server by making too many requests in a very short amount of time.

    The timer will cause JMeter to delay a certain amount of time before each sampler which is in its scope.

    If you choose to add more than one timer to a Thread Group, JMeter ...
    Categories
    Tutorial
  10. JMeter Listeners

    by , 04-27-2012 at 07:26 PM
    Listeners provide access to the information JMeter gathers about the test cases while JMeter runs. The Graph Results listener plots the response times on a graph. The "View Results Tree" Listener shows details of sampler requests and responses, and can display basic HTML and XML representations of the response. Other listeners provide summary or aggregation information.

    Additionally, listeners can direct the data to a file for later use. Every listener in JMeter provides ...
    Categories
    Tutorial
  11. Error reporting

    by , 04-27-2012 at 07:26 PM
    JMeter reports warnings and errors to the jmeter.log file, as well as some information on the test run itself. Just occasionally there may be some errors that JMeter is unable to trap and log; these will appear on the command console. If a test is not behaving as you expect, please check the log file in case any errors have been reported (e.g. perhaps a syntax error in a function call).

    Sampling errors (e.g. HTTP 404 - file not found) are not normally reported in the log file. Instead ...
    Categories
    Tutorial
  12. Stopping a Test

    by , 04-27-2012 at 07:25 PM
    There are two types of stop command available from the menu:

    • Stop (Control + '.') - stops the threads immediately if possible. In Versions of JMeter after 2.3.2, many samplers are now Interruptible which means that active samples can be terminated early. The stop command will check that all threads have stopped within the default timeout, which is 5000 ms = 5 seconds. [This can be changed using the JMeter property jmeterengine.threadstop.wait ] If the threads have not stopped, ...
    Categories
    Tutorial
  13. Running a Test Plan

    by , 04-27-2012 at 07:24 PM
    To run your test plan, choose "Start" (Control + r) from the "Run" menu item. When JMeter is running, it shows a small green box at the right hand end of the section just under the menu bar. You can also check the "Run" menu. If "Start" is disabled, and "Stop" is enabled, then JMeter is running your test plan (or, at least, it thinks it is).

    The numbers to the left of the green box are the number of active threads / total number of ...
    Categories
    Tutorial
  14. Running JMeter

    by , 04-27-2012 at 07:24 PM
    To run JMeter, run the jmeter.bat (for Windows) or jmeter (for Unix) file. These files are found in the bin directory. After a short pause, the JMeter GUI should appear.

    There are some additional scripts in the bin directory that you may find useful. Windows script files (the .CMD files require Win2K or later):

    • jmeter.bat - run JMeter (in GUI mode by default)
    • jmeter-n.cmd - drop a JMX file on this to run a non-GUI test
    • jmeter-n-r.cmd - drop a ...
    Categories
    Tutorial
  15. JMeter's Classpath

    by , 04-27-2012 at 07:23 PM
    The classes from jars are automatically found by the Jmeter in the following directories:

    JMETER_HOME/lib - used for utility jars
    JMETER_HOME/lib/ext - used for JMeter components

    One point to remember here is that you should jar any JMeter components developed by you and also you need to copy the jar into JMeter's lib/ext directory. JMeter components will be automatically found by the JMeter in any jars found here.

    Furthermore you should define ...
    Categories
    Tutorial
  16. The principle of JMeter

    by , 04-27-2012 at 07:22 PM
    The principle of JMeter is very simple. If you want to test e.g. a SOAP interface layer, all you basically need is the URL and SOAP request. Starting with that you can build your test plan. And this can be as fancy as you want. Using variables, counters, parameters, CSV files, loops, logs, etc. There are almost no limits in designing your test and making it as maintainable as possible.

    Name:  1.jpg
Views: 2049
Size:  27.2 KB
    The principle of JMeter
  17. JMeter Installation

    by , 04-27-2012 at 07:21 PM
    The installation of JMeter (if you would call it an installation) is pretty straight forward. On the website is a link to the download area of stable versions. You also have the possibility to use nightly builds, but this is at your own risk. No guarantee that they work properly. So the advice is always to start with a stable version.

    Download the latest version (zip or tgz) and unpack the archive to a local folder. Before starting JMeter it is wise to have a look at the configuration. ...
    Categories
    Tutorial
  18. Apache JMeter Features

    by , 04-27-2012 at 07:20 PM
    Apache JMeter features include:
    • Can load and performance test many different server types:
    o Web - HTTP, HTTPS
    o SOAP
    o Database via JDBC
    o LDAP
    o JMS
    o Mail - POP3(S) and IMAP(S)
    • Complete portability and 100% Java purity .
    • Full multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
    • Careful GUI design allows faster operation ...
    Categories
    Tutorial
  19. Apache JMeter

    by , 04-27-2012 at 07:19 PM
    The Apache JMeter™ desktop application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

    Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a ...
    Categories
    Tutorial
  20. Batch Updates and Transactions

    by , 04-27-2012 at 07:18 PM
    It is important to keep in mind, that each update added to a Statement or PreparedStatement is executed separately by the database. That means, that some of them may succeed before one of them fails. All the statements that have succeeded are now applied to the database, but the rest of the updates may not be. This can result in an inconsistent data in the database.

    To avoid this, you can execute the batch update inside a transaction. When executed inside a transaction you can make ...
  21. PreparedStatement Performance

    by , 04-27-2012 at 07:11 PM
    It takes time for a database to parse an SQL string, and create a query plan for it. A query plan is an analysis of how the database can execute the query in the most efficient way.
    If you submit a new, full SQL statement for every query or update to the database, the database has to parse the SQL and for queries create a query plan. By reusing an existing PreparedStatement you can reuse both the SQL parsing and query plan for subsequent queries. This speeds up query execution, by decreasing ...
  22. J2EE PreparedStatement Cache

    by , 04-27-2012 at 07:10 PM
    J2EE PreparedStatement Cache is implemented using a cache inside the J2EE server connection pool manager. The J2EE server keeps a list of prepared statements for each database connection in the pool. When an application calls prepareStatement on a connection, the application server checks if that statement was previously prepared. If it was, the PreparedStatement object will be in the cache and this will be returned to the application. If not, the call is passed to the jdbc driver and the query/preparedstatement ...
  23. PreparedStatements and J2EE servers

    by , 04-27-2012 at 07:09 PM
    Things can get more complicated when we use a J2EE server. Normally, a prepared statement is associated with a single database connection. When the connection is closed, the preparedstatement is discarded. Normally, a fat client application would get a database connection and then hold it for its lifetime. It would also create all prepared statements eagerly or lazily. Eagerly means that they are all created at once when the application starts. Lazily means that they are created as they are used. ...
  24. How does a database execute a statement?

    by , 04-27-2012 at 07:09 PM
    Obviously, don't expect alot of detail here; we'll only examine the aspects important to this article. When a database receives a statement, the database engine first parses the statement and looks for syntax errors. Once the statement is parsed, the database needs to figure out the most efficient way to execute the statement. This can be computationally quite expensive. The database checks what indexes, if any, can help, or whether it should do a full read of all rows in a table. Databases use ...
  25. Supplying Values for PreparedStatement Parameters

    by , 04-27-2012 at 07:08 PM
    You must supply values in place of the question mark placeholders (if there are any) before you can execute a PreparedStatement object. Do this by calling one of the setter methods defined in the PreparedStatement class. The following statements supply the two question mark placeholders in the PreparedStatement named updateSales:

    Java Code:
    updateSales.setInt(1, e.getValue().intValue());
    updateSales.setString(2, e.getKey());
    The first argument for each of ...
  26. Overview of Prepared Statements

    by , 04-27-2012 at 07:06 PM
    Sometimes it is more convenient to use a PreparedStatement object for sending SQL statements to the database. This special type of statement is derived from the more general class, Statement, that you already know.

    If you want to execute a Statement object many times, it usually reduces execution time to use a PreparedStatement object instead.

    The main feature of a PreparedStatement object is that, unlike a Statement object, it is given a SQL statement when it is created. ...
  27. Getting and Using Pooled Connections

    by , 04-27-2012 at 07:06 PM
    A connection pool is a cache of database connection objects. The objects represent physical database connections that can be used by an application to connect to a database. At run time, the application requests a connection from the pool. If the pool contains a connection that can satisfy the request, it returns the connection to the application. If no connections are found, a new connection is created and returned to the application. The application uses the connection to perform some work on ...
    Categories
    Connection
  28. Advantages of DataSource Objects

    by , 04-27-2012 at 07:05 PM
    Because of its properties, a DataSource object is a better alternative than the DriverManager class for getting a connection. Programmers no longer have to hard code the driver name or JDBC URL in their applications, which makes them more portable. Also, DataSource properties make maintaining code much simpler. If there is a change, the system administrator can update data source properties and not be concerned about changing every application that makes a connection to the data source. For example, ...
  29. Using DataSource Objects to Get a Connection

    by , 04-27-2012 at 07:04 PM
    Objects instantiated by classes that implement the DataSource represent a particular DBMS or some other data source, such as a file. A DataSource object represents a particular DBMS or some other data source, such as a file. If a company uses more than one data source, it will deploy a separate DataSource object for each of them. The DataSource interface is implemented by a driver vendor. It can be implemented in three different ways:

    • A basic DataSource implementation produces standard ...
    Categories
    Connection
  30. Establishing a Connection

    by , 04-27-2012 at 07:03 PM
    First, you need to establish a connection with the data source you want to use. A data source can be a DBMS, a legacy file system, or some other source of data with a corresponding JDBC driver. Typically, a JDBC application connects to a target data source using one of two classes:

    • DriverManager: This fully implemented class connects an application to a data source, which is specified by a database URL. When this class first attempts to establish a connection, it automatically
    ...
Page 5 of 48 FirstFirst ... 3456715 ... LastLast