speedyguy
Cyborg Agent
im using eclipse 3.3 to create a dynamic web project (jsp) using websphere (apache geronimo) server and db2....
i have used the following code to connect to db2 from jsp-
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:db2://localhost:50000/VIR_CLS","Abhinav","studioworks");
String sql="SELECT id from login";
Statement st=con.createStatement();
ResultSet rs= st.executeQuery(sql);
........
i have got the database up and connected in my "datasource explorer" in eclipse but how do retrieve data to my jsp pages.
on exporting it to server and running i get this error message on 1st line of connection code -
java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
java.lang.Class.forNameImpl(Native Method)
java.lang.Class.forName(Class.java:130)
org.apache.jsp.login_jsp._jspService(login_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
any help possible?
thanks
Enjoy~!
i have used the following code to connect to db2 from jsp-
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
Connection con=DriverManager.getConnection("jdbc:db2://localhost:50000/VIR_CLS","Abhinav","studioworks");
String sql="SELECT id from login";
Statement st=con.createStatement();
ResultSet rs= st.executeQuery(sql);
........
i have got the database up and connected in my "datasource explorer" in eclipse but how do retrieve data to my jsp pages.
on exporting it to server and running i get this error message on 1st line of connection code -
java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
java.lang.Class.forNameImpl(Native Method)
java.lang.Class.forName(Class.java:130)
org.apache.jsp.login_jsp._jspService(login_jsp.java:74)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
any help possible?
thanks
Enjoy~!