devaki hanumante

Greenhorn
+ Follow
since Jan 18, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by devaki hanumante

Hi,

I have the below code -

Class CardCache
--------------------
private static ConcurrentMap<CacheKey,List<Card>> CardMap = new ConcurrentHashMap<CacheKey, List<Card>>();


Service Class
---------------
List<Card> Cards = null;
Cards = CardCache.getCards("USA"); //Lets say this returns 5 cards
Cards.addAll(CardCache.getRateCards("NA")); //This returns 1. So I should have 6 cards in my Cards list. But along with this, my CardCache is also getting updated with a duplicate card having the value "NA"

I am not sure why this is the case.
Any help is appreciated.

9 years ago
Hi,

I am using a JBOSS 4.2 version with eclipse and the server was working fine till yesterday.
Since yesterday it is not starting in the debug mode although it works perfectly fine in the normal mode.
While starting in the debug mode I am getting the below error:

JBoss v4.2 at localhost [Generic Server]
org.jboss.Main at localhost:1818
Thread [main] (Suspended (exception NameNotFoundException))
NamingServer.getBinding(String) line: 529
NamingServer.getBinding(Name) line: 537
NamingServer.bind(Name, Object, String) line: 142
NamingContext.bind(Name, Object) line: 591
NamingContext.bind(String, Object) line: 552
InitialContext.bind(String, Object) line: not available
JaasSecurityManagerService.startService() line: 459
JaasSecurityManagerService(ServiceMBeanSupport).jbossInternalStart() line: 289
JaasSecurityManagerService(ServiceMBeanSupport).jbossInternalLifecycle(String) line: 245
GeneratedMethodAccessor3.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
ReflectedDispatcher.invoke(Invocation) line: 155
Invocation.dispatch() line: 94
Invocation.invoke() line: 86
XMBean(AbstractMBeanInvoker).invoke(String, Object[], String[]) line: 264
MBeanServerImpl.invoke(ObjectName, String, Object[], String[]) line: 659
ServiceController$ServiceProxy.invoke(Object, Method, Object[]) line: 978
$Proxy0.start() line: not available
ServiceController.start(ObjectName) line: 417
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
ReflectedDispatcher.invoke(Invocation) line: 155
Invocation.dispatch() line: 94
Invocation.invoke() line: 86
XMBean(AbstractMBeanInvoker).invoke(String, Object[], String[]) line: 264
MBeanServerImpl.invoke(ObjectName, String, Object[], String[]) line: 659
MBeanProxyExt.invoke(Object, Method, Object[]) line: 210
$Proxy4.start(ObjectName) line: not available
SARDeployer.start(DeploymentInfo) line: 302
MainDeployer.start(DeploymentInfo) line: 1025
MainDeployer.deploy(DeploymentInfo) line: 819
MainDeployer.deploy(URL) line: 782
MainDeployer.deploy(String) line: 766
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
ReflectedDispatcher.invoke(Invocation) line: 155
Invocation.dispatch() line: 94
NullInterceptor(AbstractInterceptor).invoke(Invocation) line: 133
Invocation.invoke() line: 88
ModelMBeanOperationInterceptor.invoke(Invocation) line: 142
Invocation.invoke() line: 88
XMBean(AbstractMBeanInvoker).invoke(String, Object[], String[]) line: 264
MBeanServerImpl.invoke(ObjectName, String, Object[], String[]) line: 659
MBeanProxyExt.invoke(Object, Method, Object[]) line: 210
$Proxy5.deploy(String) line: not available
ServerImpl.doStart() line: 482
ServerImpl.start() line: 362
Main.boot(String[]) line: 200
Main$1.run() line: 508
Thread.run() line: not available
Thread [DestroyJavaVM] (Running)
Daemon Thread [Timer-0] (Running)
Daemon Thread [ScannerThread] (Running)
Daemon Thread [JBoss System Threads(1)-1] (Running)
Daemon Thread [JBoss System Threads(1)-2] (Running)
C:\Program Files\Java\jre6\bin\javaw.exe (Feb 23, 2012 10:49:54 AM)

This is present in my mysql-ds file :
<connection-url>jdbc:mysql://localhost:3306/db_name</connection-url>
to connect to my db.

Please help

12 years ago
Hi,

I have a object of a table named mert in my project.(objMERT)
Now i want to copy all the values of this object to another object say objMERT1.
How do I go about that in JAVA.

Regards,
Devaki
13 years ago
I want to assign the value of one timestamp to another in java.
eg:
Timestamp1=timestamp2;

now after that i write the following piece of code
t1.setHours(00);
t1.setMinutes(00);

as a result of this even timestamp2 is getting changed.
is this because they both point to the same object..how do i assign the value of timestamp2 to timestamp1?
13 years ago
div_buyer.innerHTML = div_buyer.innerHTML +"<p>Buyer id : <input type='text' name='buyer' + i value=' ' id='buyer' + i></p>"

I didnt exactly get you
If i replace id='buyer' and name='buyer' then it is working fine
Hi

I have the following piece of code which is called by clicking a button.I have a JavaScript variable 'i' which i want to assign as an id to the dynamically generated text boxes.

var i=1;

function add_buyer1()
{
i=i+1; div_buyer.innerHTML = div_buyer.innerHTML +"

Buyer id : <input type='text' name='buyer' + i id='buyer' + i value=' ' >

"


}

Now as the textboxes get added i want their names and id's to be buyer1,buyer2.....
How do I achieve that?
id='buyer' + i is not working

Thanking you in advance.
Where is the liabrary Oracle XML SQL Utility library (oracle.xml.sql.query.OracleXMLQuery) located in the Oracle 10g Express edition folder.I need to import this package but I get an error that the package cannot be found

Any help will be appreciated
thanks
15 years ago
I have jdk 1.5
I had copied the jar files in lib in eclipse
then it gave me the null
SQLException caught:Io exception: Got minus one from a read call error

When I copy the files to tomcat web apps it is giving me the same error
What could be the problem?
I tried using the tomcat server
it is giving the following output

null
Couldn't Load database driver: oracle.jdbc.driver.OracleDriver

So I thik there is a problem with the driver.Do you need to set any environment variables to make the driver work.If yes,what are those
Thanks
Yes.I can login to 10g from the sql prompt.
8081 is the db port no.The home page of 10g is opening correctly.
hi
i have created the following servlet which i want to connect to oracle 10g.

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Connection con = null;
String driver = "oracle.jdbc.driver.OracleDriver";
String serverName ="devaki";
String portNumber = "8081";
String sid = "";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber+ ":" + sid;

String username = "system";
String password = "tiger";





PrintWriter out = response.getWriter();

//Retrieving values from HTML page
String CourseName=request.getParameter("CourseName");

String CourseId=request.getParameter("CourseId");
String CourseCapacity=request.getParameter("CourseCapacity");
String CourseDesc=request.getParameter("CourseDesc");
String CourseDuration=request.getParameter("CourseDuration");

try {

Class.forName(driver);
con = DriverManager.getConnection(url, username,password);


String sql = "insert into Course values(?,?,?,?,?)";
PreparedStatement pst = con.prepareStatement(sql);

pst.setString(1, CourseId);
pst.setString(2, CourseName);
pst.setString(3, CourseCapacity);
pst.setString(4, CourseDesc);
pst.setString(5, CourseDuration);


pst.executeUpdate();
pst.close();



pst.close();
con.close();
}

catch (ClassNotFoundException e){
out.println("Couldn't Load database driver: "+e.getMessage());
}

catch (SQLException e){
out.println("SQLException caught:"+e.getMessage());
}

catch (Exception e) {
out.println(e); }
finally
{
try
{
if (con!= null)
con.close();
}
catch(SQLException ignored)
{

out.println(ignored);

}
}
}
}


I am getting the error SQLException caught:Io exception: Got minus one from a read call
I think that he error is at the line con = DriverManager.getConnection(url, username,password);
My servlet is not getting connected to the database.
Is it because i also have oracle 8i installed on my machine.Do I need to uninstall it first?
I am using Eclipse Ganymede for execution of the servlet

Any help will be appreciated
Thanks