Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

help in creating DAL

 
Ranch Hand
Posts: 152
Eclipse IDE Chrome 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
 
author & internet detective
Posts: 39986
806
Eclipse IDE VI Editor Java
 
Pravin Shirke
Ranch Hand
Posts: 152
Eclipse IDE Chrome 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
Posts: 39986
806
Eclipse IDE VI Editor Java
  • 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
Eclipse IDE Chrome 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
Posts: 39986
806
Eclipse IDE VI Editor Java
  • 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
Eclipse IDE Chrome 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.
 
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
Eclipse IDE Chrome 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
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic