Nareshkumar Kapilavai

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

Recent posts by Nareshkumar Kapilavai

Hi,
can any one provide the example links for one-to-one,one-to-many,many-to-one,many-to-many association mappings in hibernate.
Thank you for your reply. i found the problem.problem is not with my code.it is something other problem with the database.when i change the database from HSQLDB to mysql it is working fine.Thank you very much.
Hi,
i am new to the hibernate. i am trying to do some sample application with hibernate using HSQLDatabase. i am able to retriving the data from the database. but when i am trying to save the data in to the database.. it is not inserting.i am using increment as a generator class for Id.after executing the program it is showing following information in the console..

Hibernate: select max(id) from BOOK
Hibernate: insert into BOOK (bookname, id) values (?, ?)

but in the database it is not showing the inserted data.i am not getting any exception also. when i try to retrive the data from the database using Query.list()it is retriving normally.

please see the code bellow what i did:

main class:

session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
Book b1 = new Book();
b1.setLngBookId(1);
b1.setStrBookName("testData");
session.save(b1);
session.getTransaction().commit();

hbm file:

<hibernate-mapping>
<class name="test.Book" table="BOOK">
<id name="lngBookId" type="long" column="id" >
<generator class="increment"/>
</id>
<property name="strBookName">
<column name="bookname" />
</property>
</class>
</hibernate-mapping>

cfg file:

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:file :\PAYMENTS\HSQLDB</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="show_sql">true</property>
<mapping resource="book.hbm.xml"/>
</session-factory>
</hibernate-configuration>




please give me the solution to my problem.

Thanks & regards!!
Naresh Kapilavai
Thanks for your valuble suggetions.
but here i am able to assign the value to input text.but in case of output text i am not able to assign the value.if i assign the value to input text id the modification is haapeening. but if i am trying to assign the value to out put text id it is not happening.
eventhow my Scenario in dataTable.. i am putting the button for every row. so when i clicking on the button that particular row values it is taking.
17 years ago
JSF
Hi,
i am very new to jsf.i am trying to assign some value to output text id from java script function. that output text is in one of the row of data table. but it is not happening.that output text value is not changing.can any body sugest me that wheather it is possible or not.

and another one is i need to change the color of some out put text value from onclick javascript function. in normal html i can do this thing by using some span tags.i need to change the style of output text value from javascript function.can any body suggest me that how can i do my requirment in jsf.

Thanks in advance.

Thanks & regards
Naresh
17 years ago
JSF
Hi,
I got the solution by using java.math.BigDecimal Class.there is a methode called toEngineeringString();
Thanks
Naresh
17 years ago
Hi
I need to print the Double Value with 2 decimal digits. i am getting the double value like 1.07142858E7,but actually i need to show the value like this 10714285.8(this is the converted value)
Can any one suggest me that how can i print the converted value. (1.07142858E7 as 10714285.8)

Thank you
Naresh
17 years ago
Hi,
i am using Tomahawk component for JSF File uploading.. When I submit, nothing happens.means my backend bean methode is not calling. it is not displaying the errors also.can any one sugest the solution for my problem..
Thanks in advance.
Naresh kumar
17 years ago
JSF
Hi,
i have a list of strings having some order, i need to sort the another list based on the first list.for ex. in the first list contains the values
in following order

CURR
REPO
TBD
TBL
TN
BA
CD
CP
TD
CN
AGCY
DN
MUNI
COM
CB

and my second list is like this..

DN
DN
DN
TD
TD
TD
TBD
TBD
TBD
CURR
BA
BA


i need to sort the second list values based on the first list order.. if there is any new values in the second list, which are not held in the first list shoulb be come bottom of the second list..

please suggest me the logic for this.
Thanks
Naresh
17 years ago
hi,
i tried that one also :-( ,even i have given some wrong class name in listener class tag of weblogic-application.xml,it is not giving any error. thats why i decided it is not reading weblogic-application.xml
17 years ago
hi,
i did all these things.but it is not able to pickup the listener class.. even i am unable to find out warning or error message regarding to this listner class in stack trace. i configured weblogic-application.xml as like this :

<!DOCTYPE weblogic-application PUBLIC
"-//BEA Systems, Inc.//DTD WebLogic Application 8.1.0//EN"
"weblogic-application_2_0.dtd">
<weblogic-application>

<listener>
<listener-class>com.oppen.rsd.batch.RSDJobListener</listener-class>
<listener-uri>scheduler.jar</listener-uri>
</listener>

</weblogic-application>

i was downloaded that weblogic-application_2_0.dtd file and configured in my application..
can any one try this example??
17 years ago
Hi
sorry for the late reply.. here i am copying my scheduler program..

import java.util.Calendar;
import java.util.Date;

import javax.management.InstanceNotFoundException;
import javax.management.Notification;
import javax.management.NotificationListener;

import weblogic.management.timer.Timer;

public final class RSDJobScheduler implements NotificationListener {

private static final long DAILY_PERIOD = Timer.ONE_DAY;

private Timer timer;
private Integer orderNotificationId;


public RSDJobScheduler(){
// Instantiating the Timer MBean
timer = new Timer();
// Registering this class as a listener
timer.addNotificationListener(this, null, "some handback object");

// These values should be read from a property file
int reconReportHour=14;
int reconReportMinute=32;

Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,reconReportHour);
calendar.set(Calendar.MINUTE,reconReportMinute);
Date orderSubmissionDate = calendar.getTime();
System.out.println("orderSubmissionDate>>> "+orderSubmissionDate);


// Add the Reconciliation Report which should run every day
orderNotificationId = timer.addNotification("ReconReport",
"Reconciliation Report", this,orderSubmissionDate, timer.ONE_MINUTE,0);



timer.start();
System.out.println( "#################>>> RSDJobScheduler started." );

}
protected void finalize() throws Throwable
{
System.out.println("#################>>> RSDJobScheduler finalize called.");
cleanUp();

super.finalize();
}

public synchronized void cleanUp()
{
System.out.println("#################>>> RSDJobScheduler cleanUp method ?called.");
try
{
timer.stop();
timer.removeNotification(orderNotificationId);
//timer.removeNotification(inventoryNotificationId);
System.out.println("#################>>> RSDJobScheduler Scheduler ?stopped.");
}
catch (InstanceNotFoundException e)
{
e.printStackTrace();
}
}

/* callback method */
public void handleNotification(Notification notif, Object handback)
{
String type = notif.getType();
if ( type.equals("ReconReport") )
{
Calendar calendar = Calendar.getInstance();
System.out.println("Reconciliation Report Started >>>>>>>> " + calendar.getTime().toString());
// invoke the component or ejb that does the order processing ?and submission
}
}

public static void main(String[] args)
{
RSDJobScheduler rsdJobScheduler = new RSDJobScheduler();
}

}



.. if iam trying to configure the listner class in web.xml it is able to call that listener(constructer not the specified methodes like preStart(),postStart() etc).but if i am trying to configure in weblogic-application.xml it is not able to call that listener. i was placed my weblogic-application.xml in META-INF folder.even i tried place that file in different locations it is not able to call.
17 years ago
Hi,
I am trying to configure job scheduling in weblogic server.i wrote Listener ,JobScheduler and i configured listener class in weblogic-application.xml.. but iam unable to find out that schudling after deployed my application,
here iam providing the code what i did..

listener class:


import weblogic.application.ApplicationLifecycleListener;
import weblogic.application.ApplicationLifecycleEvent;


public class RSDJobListener extends ApplicationLifecycleListener {
RSDJobScheduler rsdJobScheduler;

public void preStart(ApplicationLifecycleEvent evt)
{
System.out.println("RSDJobListener reStart Event");
}

public void postStart(ApplicationLifecycleEvent evt)
{
System.out.println( "RSDJobListener ostStart Event");

// Start the Scheduler
rsdJobScheduler = new RSDJobScheduler();
}

public void preStop(ApplicationLifecycleEvent evt)
{
System.out.println( "RSDJobListener reStop Event");

// Stop the Scheduler
rsdJobScheduler.cleanUp();

}

public void postStop(ApplicationLifecycleEvent evt)
{
System.out.println( "RSDJobListener ostStop Event");
}

public static void main(String[] args)
{
System.out.println( "RSDJobListener:main method");
}
}



Scheduler class :


import weblogic.application.ApplicationLifecycleListener;
import weblogic.application.ApplicationLifecycleEvent;


public class RSDJobListener extends ApplicationLifecycleListener {
RSDJobScheduler rsdJobScheduler;

public void preStart(ApplicationLifecycleEvent evt)
{
System.out.println("RSDJobListener reStart Event");
}

public void postStart(ApplicationLifecycleEvent evt)
{
System.out.println( "RSDJobListener ostStart Event");

// Start the Scheduler
rsdJobScheduler = new RSDJobScheduler();
}

public void preStop(ApplicationLifecycleEvent evt)
{
System.out.println( "RSDJobListener reStop Event");

// Stop the Scheduler
rsdJobScheduler.cleanUp();

}

public void postStop(ApplicationLifecycleEvent evt)
{
System.out.println( "RSDJobListener ostStop Event");
}

public static void main(String[] args)
{
System.out.println( "RSDJobListener:main method");
}
}


and weblogic-application.xml

<weblogic-application>
<listener>
<listener-class>com.oppen.rsd.batch.RSDJobListener</listener-class>
</listener>
</weblogic-application>

please give me the solution for my problem,it is not giving any error.. but it is not calling the scheduler.

Thanks&Regards
Naresh
17 years ago
i am very sorry to all. i am unable to add my jsp code here. i dont know what is the problem. please ignore this post.
..naresh
17 years ago
JSF
Hi,
i am trying to use <h:selectBooleanCheckBox> in side <h:dataTable>. my requirement is need to edit the table cells..

;;;please see my code in attachement.


..allActionTypeNames() methode return list of valueObjects.as per the above code whenever we are selecting that checkbox.. the output text need to change like the textbox.but it is not happening like that.

the editable property i mentioned like this ..

private boolean editable = false;
.
.
public boolean isEditable() {
return editable;
}
public void setEditable(boolean editable) {
this.editable = editable;
}

.. please give me the solution for my problem.

Thanks&Regards!
Naresh.
17 years ago
JSF