adi sembiring

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

Recent posts by adi sembiring


Hello ....

I'm trying to create registration form using Spring MVC and Velocity as view. in the view there are inputs: username email password confirmpassword birthday -> format MM/dd/yyyy

when user submit the form, my controller validate the form input/command. if there some error, it will show back to the view and print the birth day in correct format.

but the date printed as not formated date. I try use $dateTool.format('MM/dd/yyyy', $registration.BirthDay) but the birthday value still not formated.

any help needed.

Thanks
13 years ago
Hi ...

I usually use WorkManager to implement parallel processing in websphere. and my case is:
I implement synchronize payment data from core banking to university, the sync process will occurred every 5 minutes untill completed. During the sync:
* I create Worker for each university, this worker used to sync data from core banking to univeristy
* get WorkManager usng JNDI, and ask the work manager run the UniversityWorker.

Do you have any idea, implementing this case in glassfish ?
14 years ago

Rob Prime wrote:

adi sembiring wrote:I need suggestion how to fix this problem and prevent my application being crash?


Always close resources that aren't needed anymore. Not just SQL connections but (Prepared)Statements, ResultSets, InputStreams, OutputStreams, Readers, Writers, etc. You usually do this in a finally block. You can use nested try-finally blocks if you have more than one resource. For instance:
It may look confusing, but this way ensures that all resources will always be closed, even if exceptions occur. The nesting prevents a) having to check against null, and b) because close() can also throw an exception, that failing to close one resource will lead to other resources not being closed.



Honestly I use Hibernate to make data access to the database.

while the anotationconfiguration build session factory, it will make connection and add the connection pooling. should I close the session factory even though I get exception when the buildSessionFactory can not connect to the database host ?
14 years ago
I develop application run in Websphere work manager. work manager is used to run thread in the webpshere applications erver.

Every 5 minutes my thread try to get some data from MySQL database from the different host from the application server machine.

When the Host of MySql database turned off, The work manager always try to connect to MySQL database and I know my program will always get exception connection failure. this is the exception: com.mysql.jdbc.CommunicationsException:



But, over time my program get exception as follows:



and this exception make my application server crash:



I need suggestion how to fix this problem and prevent my application being crash?



WorkEnvironment:

14 years ago
Hi ...., I wanna build ApplicationSetting to my application. the application setting can be stored in a file properties or in a database table. the content of applicatino setting is key and value. ex:




I have design my code bellow:
AppSettings Reader



Application Setting Class



Test



so, my questions are:
1. Give your opinion about my code, is there some thing wrong ?
2. I configure my application setting once, while the application start, I configure the application setting with appropriate reader (DbReader or PropertiesReader), I make it singleton. The problem is, While some user edit the database or file directly to database or file, I can't get the changed. now, I wanna implement like ApplicationSettingChangeListener. so if the data change, i will refresh reconfigure my application setting. do you have suggestion ?
14 years ago
I use http://illegalargumentexception.blogspot.com/2008/08/ant-automated-deployment-to-websphere.html as my reference. and http://illegalargumentexception.googlecode.com/svn/trunk/code/java/WebSphereAntFiles/ as my sample code to deployed.

this is my buil.properies is ?



this is my console while I trying to build with ws_ant.bat


14 years ago
Hi .. I'm trying to create mysql datasource in websphere. I have setup the data source and test the data source from the admin console. I used ConnectJDBCDataStoreHelper as datasource helper.

Now, I'm trying to access the datasource from desktop application using Hibernate. I've set the JNDI URL, ContextFactory and etc. And I have reference was 7 library in my project.

While I try to run, there are some error occurred. com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper not found. I think i must include the jar file. but I don't get the file
14 years ago

Ulf Dittmer wrote:Welcome to JavaRanch.

MVC is a GUI concept; if you don't mean web apps, are you asking about Swing GUIs? Swing has the M-V-C separation to some degree built in. For example, if a JTable is a view, then its TableModel and TableComunModel constitute the model, and your event handlers -either attached to the JTable or some other Swing component- would be the controller.



Can you suggest me about book or web tutorial with an example application for creating CRUD application. So I can understand this concept ???

thanks
Is there any MVC framework in Java SEE.

if in Java EE we can use Spring or Struts, how about Java SE ??