hey friends I am learning struts Framework and using Oracle as backend.But i dont know how to use it.can anyone tell what i have to do for it?What drivers I would be needing? and the datasource configuration?Currently i am using mysql as backend.
regards
SCJP 1.4 (86%)<br />SCWCD 1.4 (86%)<br />----------<br />If You dont succeed at first time,call it Version 1.0 !!!
If you are already using MySQL, then you don't need to update much of your code. You need to change some details in struts-config.xml file or web.xml file.
Oracle comes with the drivers you need to use, so don't worry about the drivers. Oracle comes with Type2 OCI driver and Type4 pure Java driver.
Originally posted by sarang bharambe: hey friends I am learning struts Framework and using Oracle as backend.But i dont know how to use it.can anyone tell what i have to do for it?What drivers I would be needing? and the datasource configuration?Currently i am using mysql as backend.
regards
Hi little bit specific
this is how u can use
public class StudentDao { Connection con = null; Statement st = null; ResultSet rs = null; DataSource ds = null; Context ctx = null; String item = null; String value = null; boolean flag = false; String skill= null; String jcode = null; String loc = null; String pos = null; String desc = null; int max = 0; int min = 0; //HttpSession workSession = null; //workSession = req.getSession(true);
public static void display() { System.out.println(" i am from dao display"); }
public Collection getSubjects() throws Exception { ArrayList list = new ArrayList(); try { Properties p = System.getProperties(); p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); p.put(Context.PROVIDER_URL,"t3://localhost:7001"); ctx = new InitialContext(p); ds = (DataSource) ctx.lookup("RmsJndi2"); con = ds.getConnection(); st = con.createStatement(); con.setAutoCommit(true); rs = st.executeQuery("select * from combo");