Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

vitesse wei

Ranch Hand
+ Follow
since Sep 07, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vitesse wei

I have a legacy web application that use Java log "java.util.logging.Logger"
recently I create another EJB module project (jar),extended web app use this EJB module.
when I deploy I put both web app and EJB module into one Enterprise Application project(ear),
my question is that how can I implement log for my EJB project,continue use Java log like web app?,log into same file? or should i use different log file for EJB?
or change that java log to Log4J,so still same log file or different log file?
if it is one same log file,should I implement in sub projects level or top project level?

thanks ranchers.
10 years ago
I just go through the prototype pattern with a shallow clone implementation,code as bellow:



in Clone method,we call super.clone(),that return a Object,this Object is not a Product and we know that Product is a Object,how can we cast the Object to Product in main body without error?,
thanks ranchers
10 years ago
Although.It is a pretty old thread,but lots people googled this page for a solution
I find one,and attach here for future people reference.
this is referenced from glassfish2 Q/A

I have an EJB component with a Local interface. Can I access it from a web component in a different application?

No. The EJB specification only requires access to an EJB component's local EJB interface from within the same application in the same JVM. One option is to package the ejb-jar in the same .ear as the .war. A second option, if using GlassFish v3, is to package the EJB component directly within the .war.

finally,I get it worked.

use EE application project which will include a EJB project and WEB project will solve problem.
hi,

I am working on a legacy project which have jsf and icefaces to call EJB which in turn call webservice to get data from database.
now we want web call EJB3,then EJB3 call hibernate(or Toplink) to get(update) data in database,IDE is NetBeans 6.5.1,I am struggling to integrated all of them together
,also the app server is Glassfish 2.
Is this possible,or your Java EE guys have better advice based on your experience,such as another IDE,or technologies to do the work,app server can not be changed.

thanks advance!
hi,folks
I have a Jtable displaying data from database,and in some fields,like language,I attached a customerized cell render and editor,everything is fine when I started Jtable,but When I drag and drop language column to other place,the editor is fine,but the render is rendering data with a wrong way,I suppose english and french will render green,others will be red,but after drag-and-drop the column,it render right data to red.
is there any body ever had this situation or know where is the possible problem?
thanks advance!(I didn't post code because it is quite big).


11 years ago
For database connection,I just create serverl PUs in persistence.xml file,then when create EntityManager,I will use specific PU,the changes for persisence file solved

Another one is still there,How can we change the property of Schema in annotation @Table from Entity class? or can we leave it empty,then put schema in some where in PU?
Hi,
I have a Swing project used persistence unit connect to database,and I also have several Entity classes to persist with database tables,information was displayed in a Swing Jtable ,appliation works fine with current database and table.
problems is that I want change database connection property in the persistance.xml file when i started application,can I change the persistence.xml file in my main method or main class constuctor?
another problems is that I also want change the schema in Entity class's Table annotation,sames like I have to change the source code and then recompile the entity class,that sames not realistic,any advice about this?
the thing behind this is tha I want change database information every time application run based on the content presented in another xml file in current folder.
any advices would be preciated!
I can update The JTextFields now,I have another problems now,How can I tell myAbstratcTableModel that data has been updated,then we need update ResultSet ,then JTable
which event litener should i implemented?
Thanks advance
12 years ago
Thanks for reply.

What I am doing here is that I don't want data to be edited in JTable cell,I want data to be edited in a JTextField in the bottom of form,because I have lots columns in JTable,so when user click a row in JTable,The JTextField which connect with a column should display that record's column's value,and let user to change the value?then change the resultSet in TableModel,later changes will submit to database.
thanks
12 years ago
Hi,Ranches

I have implemented a JTable in JScrollPane,Jtable's data comes from MyAbstractTableModel, which has a JDBC ResultSet,in JTable,data is displayed,and I can changed them,and save then back to database.
problem is that I add a JTextField in bottom of my JDialog,which is the container of JScrollPane,I want this JTextField binding with a JTable's field,in other words,I need bind the JTextField to one column of JDBC ResultSet,how to do that? or can I do that


any advice would be appreciated!

12 years ago
Hi,I need to initialize some variables of super class from my anonymous class,can I put a static code region or call super(..) in the body of my anonymous class,if not ,how to do this?
12 years ago
Hi,I have two string variables,they could have 20x5 combinations,how can i implement the code to check on specific combination,"if else" is not good design,I can not use "switch" on string,"enum" is not good too,what is the better solution for this?
12 years ago