db.prev()

Syntax long db.prev( long table_id [, long lock] ) Description This reads the previous record from a specified table. It uses the current index to search the table. If there is no current record, the function returns an error message. Arguments table_id The table ID, as returned by db.bind(). lock By default, the record is not locked before reading. Use this optional argument to apply a lock to the record. The possible values are: DB.LOCK lock record for update DB.DELAYED.LOCK apply a delayed lock to the...

db.permission()

Syntax long db.permission( long table_id [, string field(18) [, ref string buffer(.)]] ) Description Use this to check the access permissions that a user has to a specified table or table field.  Arguments table_id The table ID, as returned by db.bind(). field To check the permissions for a particular field, enter the field name here. If you do not specify a field here, or if you specify an empty string, the function returns the permissions for the table. buffer A user's permissions for a table or table field can depend on the contents...

db.set.to.default()

Syntax long db.set.to.default( long table_id ) Description This sets bound variables in the program script to the default values defined in the data dictionary. Arguments table_id The table ID, as returned by db.bind(). Return values     0 success <>0 error Related Post: Database Operatio...

db.retry.point()

Syntax void db.retry.point() Description This sets a retry point for the current transaction. The program returns to this point if an error occurs during the transaction; the transaction is then retried. When you include a retry point for a transaction, you must set it before the start of the transaction. Related Post: Database Operatio...

on.main.table()

Syntax void on.main.table( function_name [, ...] ) DescriptionThis copies the contents current record of the main table to the record buffer of that table, saves the record, and executes the specified function. After that the saved record buffer is restored. This enables you to perform actions on the record contents without affecting the values in the table. Argumentsfunction_name The name of the function that must be executed. The function must be of type void.. . .                         Use...

Java - States of Thread

The following diagram illustrates the various states that a Java thread can be in at any point during its life. It also illustrates which method calls cause a transition to another state. This diagram is not a complete finite state diagram, but rather an overview of the more interesting and common aspect of a thread's life. The remainder of this page discusses a Thread's life cycle in terms of its state. New Thread The following statement creates a new thread but does not start it, thereby leaving...

db.create.table()

Syntax long db.create.table( table table_name [, long comp_nr] ) Description This creates a new database table.  Arguments table_name The name for the new table. comp_nr This optional argument specifies a company number for the table. The default company is the company of the user. Return values     0 success <>0 error Related Post: Database Operatio...

db.unbind()

Syntax long db.unbind( long table_id ) Description This deletes the specified table pointer.  Arguments table_id The table pointer, as returned by db.bind(). Return values     0 success <>0 error Related Post: Database Operatio...

Thread methods in Java

On the previous post, we looked at how to create a thread in Java, via the Runnable and Thread objects. We mentioned that the Thread class provides control over threads. So on this page, we take a high-level look at the most important methods on this class. Thread.sleep()We actually saw a sneak preview of Thread.sleep() in our Java threading introduction. This static method asks the system to put the current thread to sleep for (approximately) the specified amount of time, effectively allowing us to implement a "pause". A thread can be interrupted...

Which method is more preferable to create a thread?

When creating threads, there are two reasons why implementing the Runnable interface may be preferable to extending the Thread class:Extending the Thread class means that the subclass cannot extend any other class, whereas a class implementing the Runnable interface has this option. A class might only be interested in being runnable, and therefore, inheriting the full overhead of the Thread class would be excessive....

Creation of a thread

A thread can be created in two ways a) By implementing the Runnable interface. The Runnable interface consists of only one method - the run method. The run method has a prototype of public void run(); b) By extending the class Thread. 1) Implementing the Runnable InterfaceThe Runnable Interface Signaturepublic interface Runnable {void run();}One way to create a thread in java is to implement the Runnable Interface and then instantiate an object of the class. We need to override the run() method into our class which is the only method that needs...

Threads in Java

Threads Multithreading refers to two or more tasks executing concurrently within a single program. A thread is an independent path of execution within a program. Many threads can run concurrently within a program. Every thread in Java is created and controlled by the java.lang.Thread class. A Java program can have many threads, and these threads can run concurrently, either asynchronously or synchronously. Thread Constructor Summary Thread() Allocates a new Thread object. Thread(Runnable target) Allocates a new Thread object. Thread(Runnable...

Yahoo,facebook,flicker can read your personal data

Top social networking sites have accepted that they can read user's personal data through their android phones. There are many phone applications which give authority to their developers to go through user's personal data like: text messages,images etc etc. Now a days it has become a major problem because internet is an inevitable part of our life, we can't even think about our life without internet because for small small work we use internet and this kind of problem will have severe effect on...

db.drop.table()

Syntax long db.drop.table( long table_id [, long ignore_refs] [, long comp_nr] ) Description This deletes a specified table. Data and indices associated with the table are also deleted. Reference counters are automatically updated.  Arguments table_id The table ID, as returned by db.bind(). ignore_refs If you set this optional argument to DB.IGNORE.ALL.REFS, the data is deleted regardless of whether it is referenced by other tables. comp_nr This optional argument specifies a company number for the table. The default company is the company...

db.delete()

Syntax long db.delete( long table_id [, long mode [, long eflag]] ) Description This deletes the current record. The record pointer is not changed, so the current record is undefined after the record has been deleted. Arguments table_id The table ID, as returned by db.bind(). mode Set this to DB.RETRY if retry points and the SELECT FOR UPDATE statement are being used. The actual database action is postponed until the transaction is committed. eflag For some errors, it is possible to indicate the action the system must perform when the error...

db.eq()

Syntax long db.eq( long table_id [, long lock] ) Description This reads from a specified table the record whose key value equals a certain predefined value. Before calling db.eq(), you must assign the required value to the key field. For example, the following code retrieves the item with item number 001 from the items table: tiitm001.item = "001" db.eq( ttiitm001 ) Arguments table_id The table ID, as returned by db.bind(). lock By default, the record is not locked before reading. Use this optional argument to apply a lock to the record....

db.update()

Syntax long db.update( long table_id [, long mode [, long eflag]] )  Description This rewrites the current record. When updating a record with this function, you are permitted to update the primary key of the record. Arguments table_id      The table ID, as returned by db.bind(). mode      This has two possible values: DB.RETRY Set this value if retry points and the SELECT FOR UPDATE statement are being used. The actual database action is postponed until the transaction is committed. DB.DELAYED.LOCK This option...

db.insert()

Syntax long db.insert( long table_id [, long mode [, long eflag]] )  DescriptionThis adds a new record to a specified table. The record pointer does not change. Argumentstable_id The table ID, as returned by db.bind().mode Set this to DB.RETRY if retry points and the SELECT FOR UPDATE statement are being used. The actual database action is postponed until the transaction is committed.eflag For some errors, it is possible to indicate the action the system must perform when the error occurs.  Return Value     0 success  >0...

What are the steps performed while loading a Java class?

Ans: Phases of class loading The are three phases of concrete class loading: physical loading, linking, and initializing. 1) In in first phase of physical loading required class file will be searched in specified classpaths. If the file is found it is read and the bytecode is loaded. This process gives a basic memory structure to the class object, such concepts like methods, fields, and other referenced classes are not known at this stage. 2) Linking can be broken down into three...

Why there are two Date classes; one in java.util package and another in Java.sql?

Ans:From the JavaDoc of java.sql.Date:  A thin wrapper around a millisecond value that allows JDBC to identify this as an SQL DATE value. A milliseconds value represents the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated. Explanation: A java.util.Date represents...

How is it possible for two String oblects with identical values not to be equal under the == operator?

Ans:The = = operator compares two objects to determine if they are the same object in memory i.e. present in the same memory location. It is possible for two String objects to have the same value, but located in different areas of memory.= = compares references while .equals compares contents. The method public boolean equals(Object obj) is provided by the Object class and can be overridden. The default implementation returns true only if the object is compared with itself, which is equivalent to the equality operator = = being used to compare...

db.bind()

Syntax long db.bind( string table_name(9) [, ref string buffer(.) [, long comp_nr]] ) Description This creates a pointer to a specified table. It returns a table ID that you use in other database calls to identify the table. The pointer is to a table with a particular company number and record buffer. You can create additional pointers to the same table by calling the function with a different company number and/or record buffer. Arguments table_name The table name. buffer This optional argument specifies the record buffer to be used for the...

activate.search()

Syntax void activate.search() DescriptionThis forces a random search action on the main table. You call the function immediately after input to a field during insertion of a new record (standard command ADD.SET or DUPL.OCCUR) or during MODIFY.SET (if the predefined variable modify.prim.key is set to TRUE).When a new record is being added to the database, the standard program normally executes a search action in the main table after input to the field(s) of the primary index. If the key values entered belong to an existing record in the main table,...

abort.transaction()

Syntax long abort.transaction() Description This cancels the current database transaction. No changes are stored in the database.  To commit a transaction and store changes made in the database, use commit.transaction() instead. Return values     0 success <>0 error Related Post: Database Operatio...

commit.transaction()

Syntax long commit.transaction() Description This ends the current transaction. All changes made during the transaction are stored in the database. To cancel a transaction, use abort.transaction() instead. Return values      0 success <>0 error Related Post: Database operatio...

Database Operations

Use these functions for handling database input and output. New features in BaanERP In BaanERP, the functions db.curr(), db.first(), db.last(), db.next(), db.prev(),db.gt(), db.ge(), db.lt() and db.le() are implemented internally as SELECT statements. They are supported for backward compatibility only. In new applications, use queries instead. In BaanERP, certain 4GL functions have Data Access Layer (DAL) equivalents. The following table lists these functions and their DAL equivalents.  4GL function          ...

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More