Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help in creating DAL

 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i want to create a DAL for my application can any body guide me how to proceed in creating it. Any help would be apprieciated
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii Jeanne,
thank you for your reply i have gone through the j2ee patters link. its good but its not what i wanted. i want to prepare a reusable class from which i can add parameters into it and call the stored procedure. to execute it. i have seen this feature in one of my collegues DAL(in .net) and i wanted to create it in java. where they add parameters to say a hashtable and call pass the direction of the parameter and finally execute the stored procedure. so how do i proceed it in java.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, DAL stands for data access layer.

I suppose you could write a method that takes in an ArrayList (HashTable is unordered) of parameters and String SQL statement. Then using reflection, you could call the appropriate stmt.set method - date, string, int, etc.
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi jeanne,
sorry for replying late was busy in some other tasks. for DAL i want to create a generic DAL which can be used with any database. how to proceed with it like i am thinking about this kinda method



but when i try to create DBUtilDBType enum it



it gives me an error i have already added the ojdbc6.jar to the lib directory.

how do i proceed kindly help..........
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see where you state what the error is.
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here in this code


OracleTypes is an Abstract class and it does not allow me to do this



even if i put a semicolon after the OracleTypes.BOOLEAN it gives the error.
kindly help.
 
Jhakda Velu
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
See what OracleTypes.BOOLEAN returns. You should be able to understand.
Jhakda
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi velu,
OracleTypes is an Abstract class and im not able to get its attributes listed in intellisense.
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic