ORA-12532: TNS:invalid argument

sqlplus system@orclSQL*Plus: Release 11.1.0.6.0 - Production on Sun Aug 19 13:18:56 2007Copyright (c) 1982, 2007, Oracle. All rights reserved.Enter password:ERROR:ORA-12532: TNS:invalid argumentIn this case we can ping to remote host but not able to connect database which we have created on remote host.Cause : Listener port is closed.May be a firewall policy make the issue.Action : We need to open Listener port for communication .By default Listener port is 15...

Insert Array Output into Database

Hello Friends now a days i am working on php.A few days ago i got a task from my trainer and task was to uploading a txt file in new folder and output should be in an array format using loops and after that insert that output into database and the content in the text file was 100 email id's.At that time i was new in php and no idea how to start my task and how to use loops.For that i searched on net for many times but i couldn't find the required data to complete task on single site.So,i had to serach many sites to collect...

Reclaiming Unused Space in Index.

We can see Reclaimable space in Schema by using below query.SELECT'Task Name : ' || f.task_name || CHR(10) ||'Start Run Time : ' || TO_CHAR(execution_start, 'dd-mon-yy hh24:mi') || chr (10) ||'Segment Name : ' || o.attr2 || CHR(10) ||'Segment Type : ' || o.type || CHR(10) ||'Partition Name : ' || o.attr3 || CHR(10) ||'Message : ' || f.message || CHR(10) ||'More Info : ' || f.more_info || CHR(10) ||'------------------------------------------------------' Advice FROM dba_advisor_findings f,dba_advisor_objects o,dba_advisor_executions e WHERE o.task_id...

" Bharat Bandh " Is it reality or just a show off.

Is the bandh is the only way to protest, what type of bandh is this where people are forced to stay home and shut down their shops. All anti social elements are having a great time. A bandh should be something where people protest by themselves. Policitcan dont their work in Parliament and does not allow us to work too. What have they gained by calling this bandh we lost one day's pay.  Its just a show off. If really the cry needs to be heard, there is no point in destroying public...

What is thread pool? Why should we use thread pools?

Ans: A thread pool is a collection of threads on which task can be scheduled. Instead of creating a new thread for each task, you can have one of the threads from the thread pool pulled out of the pool and assigned to the task. When the thread is finished with the task, it adds itself back to the pool and waits for another assignment. One common type of thread pool is the fixed thread pool. This type of pool always has a specified number of threads running; if a thread is somehow terminated while it is still in use, it is automatically replaced...

What is a thread leak? What does it mean in Java?

Ans:Thread leak is when a application does not release references to a thread object properly. Due to this some Threads do not get garbage collected and the number of unused threads grow with time. Thread leak can often cause serious issues on a Java application since over a period of time too many threads will be created but not released and may cause applications to respond slow or hang. Q:How can I trace whether the application has a thread leak?Ans:If an application has thread leak then with time it will have too many unused threads. Try to...

How will you take thread dump in Java? How will you analyze Thread dump?

Ans: A Thread Dump is a complete list of active threads. A java thread dump is a way of finding out what each thread in the JVM is doing at a particular point of time. This is especially useful when your java application seems to have some performance issues. Thread dump will help you to find out which thread is causing this. There are several ways to take thread dumps from a JVM. It is highly recommended to take more than 1 thread dump and analyze the results based on it. Follow below steps to take thread dump of a java process •Step 1 On UNIX,...

Why are wait(), notify() and notifyAll() methods defined in the object class?

Ans: The purpose of the wait(), notify() and notifyAll() methods is to temporarily pause and resume the execution of code in an object. Typically the host object is not in a state where it can proceed with a method call it has been given and the thread of execution must literally wait for the object to return to a ready state. A common example would be a limited pool or store of objects where you must wait for a storage slot to be released or an object to be returned to the pool before you can use it.public synchronized Object getNextObject() {...

What is Starvation? What is a Livelock?

Starvation and livelock are much less common a problem than deadlock, but are still problems that every designer of concurrent software is likely to encounter.LiveLockLivelock occurs when all threads are blocked, or are otherwise unable to proceed due to unavailability of required resources, and the non-existence of any unblocked thread to make those resources available. In terms of Java API, thread livelock can occur in following conditions:When all the threads in a program execute Object.wait(0) on an object with zero parameter. The program is...

What is the difference between sleep(), suspend() and wait()?

Ans:Thread.sleep() sends the current thread into the "Not Runnable" state for some amount of time. The thread keeps the monitors it has aquired -- i.e. if the thread is currently in a synchronized block or method no other thread can enter this block or method. If another thread calls t.interrupt() it will wake up the sleeping thread. Note that sleep is a static method, which means that it always affects the current thread (the one that is executing the sleep method). A common mistake is to call t.sleep() where t is a different thread; even then,...

What is ThreadLocal class? How can it be used?

Ans:Below are some key points about ThreadLocal variablesA thread-local variable effectively provides a separate copy of its value for each thread that uses it.ThreadLocal instances are typically private static fields in classes that wish to associate state with a threadIn case when multiple threads access a ThreadLocal instance, separate copy of Threadlocal variable is maintained for each thread.Common use is seen in DAO pattern where the DAO class can be singleton but the Database connection can be maintained separately for each thread. (Per...

Folder Option Not Visible In Tools Menu

Want to change your windows folder options such as Show hidden files or Hide extensions for know file types.But my folder options is not visible. How to make folder options visible under tools menu. Here is the solution: Step 1 : Goto Start Menu and Select Run otpion. Step 2 : Type gpedit.msc in run dialog box. Group Policy dialog box will be displayed. Step 3 : In Group Policy dialog box in the left pane selectuser configuration->administrative templates->windows components->windows...

How do Java threads make the environment asynchrnous?

Ans: The thread mechanism in Java begins with the main entry point thread the runtime environment creates to start a Java program. When you use that initial thread create secondary threads, each one runs independently of the other. The Java virtual machine manages the execution of the threads so they behave as if they all run at the same time, in fact each thread briefly takes turns at execution. In its simplest form there may be no communication or synchronization between multiple threads in a Java program and they each run to completion independently...

Power On Your Computer With Mouse

Want to power on your computer? Press Power Button on cabinet. Is there any other way? Yah... Double Click with your mouse. But for that you need to make some settings. Here goes the settings. Step 1 Restart your computer. Step 2 Press DEL button (F2 in some motherboards) to goto the BIOS settings. Step 3 Select Integrated Peripherals from main menu. Step 4 If PS/2 mouse power on disabled, activate it by press page up/ page down key it will became Double-Click. Step 5 Press Esc key to exit. Step 6 Press F10 to save and...

What are the advantages or usage of threads?

Ans) Threads support concurrent operations. For example,-- Multiple requests by a client on a server can be handled as an individual client thread.-- Long computations or high-latency disk and network operations can be handled in the background without disturbing foreground computations or screen updates. Threads often result in simpler programs.-- In sequential programming, updating multiple displays normally requires a big while-loop that performs small parts of each display update. Unfortunately, this loop basically simulates an operating system...

Difference between Multithreading and Multiprocessing

Multi-threading refers to an application with multiple threads running within a process, while multi-processing refers to an application organised across multiple OS-level processes.A thread is a stream of instructions within a process. Each thread has its own instruction pointer, set of registers and stack memory. The virtual address space is process specific, or common to all threads within a process. So, data on the heap can be readily accessed by all threads, for good or ill.Multi-threading is a more "light weight" form of concurrency: there...

What is difference between thread and process?

 Ans) Differences between threads and processes are:- 1. Threads share the address space of the process that  created it; processes have their own address.2. Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process.3. Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes.4. Threads have almost no overhead; processes have considerable overhead.5. New threads are...

Questions Related to Thread

Q:What’s the difference between Thread and Runnable types? Ans: Java Thread controls the main path of execution in an application. When you invoke the Java Virtual Machine with the java command, it creates an implicit thread in which to execute the main method. The Thread class provides a mechanism for the first thread to start-up other threads to run in parallel with it.The Runnable interface defines a type of class that can be run by a thread. The only method it requires is run, which makes the interface very easy to to fulfil by extending existing...

ThreadGroup Class - Access Restriction Methods

The ThreadGroup class itself does not impose any access restrictions, such as allowing threads from one group to inspect or modify threads in a different group. Rather the Thread and ThreadGroup classes cooperate with security managers (subclasses of the SecurityManager class), which can impose access restrictions based on thread group membership.The Thread and ThreadGroup class both have a method, checkAccess, which calls the current security manager's checkAccess method. The security manager decides whether to allow the access based on the group...

Some Unique Guinness World Records

1,253 Smurfs gathered in the high street in the town of Castleblayney in County Monaghan, Ireland on July 18, 2008. (Guinness World Records) 35,310 Lego Star Wars Clone Troopers in the UK. The longest skis are 534 m long and were worn by 1,043 skiers in an event organized by Danske Bank on Drottninggatan in Örebro, Sweden, on 13 September 2008. World's biggest pickup truck - 2002 Surrey resident Sarwan Singh achieved a feat, which every Sikh is going to be proud of. He set a new Guinness...

ThreadGroup Class- Methods that Operate on all Threads within a Group

The ThreadGroup class has three methods that allow you to modify the current state of all the threads within that group:resumestopsuspendThese methods apply the appropriate state change to every thread in the thread group and its subgroups.Related Posts:- Java - ThreadGroup Class ThreadGroup Class - Collection Management Methods ThreadGroup Class - Methods that Operate on the Group ThreadGroup Class - Access Restriction Methods...

ThreadGroup Class - Methods that Operate on the Group

The ThreadGroup class supports several attributes that are set and retrieved from the group as a whole. These attributes include the maximum priority that any thread within the group can have, whether the group is a "daemon" group, the name of the group, and the parent of the group.The methods that get and set ThreadGroup attributes operate at the group level. They inspect or change the attribute on the ThreadGroup object, but do not affect any of the threads within the group. The following is a list of ThreadGroup methods that operate at the group...

ThreadGroup Class - Collection Management Methods

The ThreadGroup provides a set of methods that manage the threads and subgroups within the group and allow other objects to query the ThreadGroup for information about its contents. For example, you can call ThreadGroup's activeCount method to find out the number of active threads currently in the group. The activeCount method is often used with the enumerate method to get an array filled with references to all the active threads in a ThreadGroup. For example, the listCurrentThreads method in the following example fills an array with all of the...

Java - ThreadGroup Class

The ThreadGroup class manages groups of threads for Java applications. A ThreadGroup can contain any number of threads. The threads in a group are generally related in some way, such as who created them, what function they perform, or when they should be started and stopped.ThreadGroups can contain not only threads but also other ThreadGroups. The top-most thread group in a Java application is the thread group named main. You can create threads and thread groups in the main group. You can also...

Java - Thread Group

Every Java thread is a member of a thread group. Thread groups provide a mechanism for collecting multiple threads into a single object and manipulating those threads all at once, rather than individually. For example, you can start or suspend all the threads within a group with a single method call. Java thread groups are implemented by the ThreadGroup class in the java.lang package.The runtime system puts a thread into a thread group during thread construction. When you create a thread, you can either allow the runtime system to put the new...

Thread - Deadlock

There are situations when programs become deadlocked when each thread is waiting on a resource that cannot become available. The simplest form of deadlock is when two threads are each waiting on a resource that is locked by the other thread. Since each thread is waiting for the other thread to relinquish a lock, they both remain waiting forever in the Blocked-for-lock-acquisition state. The threads are said to be deadlocked. Thread t1 at tries to synchronize first on string o1 and then on string o2. The thread t2 does the opposite. It synchronizes...

Java - Thread Joining

A thread invokes the join() method on another thread in order to wait for the other thread to complete its execution.Consider a thread t1 invokes the method join() on a thread t2. The join() call has no effect if thread t2 has already completed. If thread t2 is still alive, then thread t1 transits to the Blocked-for-join-completion state. Below is a program showing how threads invoke the overloaded thread join method. public class ThreadJoinDemo { public static void main(String[] args) { Thread t1 = new Thread("T1"); ...

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More