• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help in creating DAL

 
Ranch Hand
Posts: 152
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at the data access object pattern.
 
Pravin Shirke
Ranch Hand
Posts: 152
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see where you state what the error is.
 
Pravin Shirke
Ranch Hand
Posts: 152
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
See what OracleTypes.BOOLEAN returns. You should be able to understand.
Jhakda
 
Pravin Shirke
Ranch Hand
Posts: 152
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi velu,
OracleTypes is an Abstract class and im not able to get its attributes listed in intellisense.
thanks
reply
    Bookmark Topic Watch Topic
  • New Topic