473,554 Members | 3,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve data from Database using struts jsp

lifeisgreat20009
70 New Member
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please give me some idea where I am going wrong ??

I just want to retrieve data from my emp_mstr table and display it using my JSP file...

The table emp_mstr is as follows :-

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE EMP_MSTR(
  2.     EMP_NO VARCHAR(10) PRIMARY KEY, 
  3.     PASSWORD VARCHAR(6),
  4.     BRANCH_NO VARCHAR(10), 
  5.     FNAME VARCHAR(25), 
  6.     MNAME VARCHAR(25), 
  7.     LNAME VARCHAR(25), 
  8.     DEPT VARCHAR(30), 
  9.     DESIG VARCHAR(30), 
  10.     ADDR VARCHAR(50)
  11. );

My JSP file is as follows :-

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  4. <title>corporate bank</title>
  5. <meta name="keywords" content="" />
  6. <meta name="description" content="" />
  7. <link href="../resource/styles.css" rel="stylesheet" type="text/css" media="screen" />
  8. </head>
  9. <body>
  10. <div id="main">
  11. <!-- start header -->
  12. <div id="header">
  13.  <div id="logo">
  14.     <h1>Corporate Bank</h1>
  15.   </div>
  16. <!--Header end -->
  17. <div id="menu">
  18.   <ul>
  19.    <li><a href="#">Home</a></li>
  20.    <li><a href="#">Products</a></li>
  21.    <li><a href="#">Easy loans</a></li>
  22.    <li><a href="#">About us</a></li>
  23.    <li><a href="#">Contact</a></li>   
  24.   </ul>
  25. </div>
  26. </div>
  27.  
  28. <!-- end header -->
  29. <!-- start page -->
  30. <div id="page">
  31.     <!-- start leftbar -->
  32.     <div id="leftbar" class="sidebar">
  33.             <h2>Branch Network</h2>
  34.  
  35.              <div class="back">
  36.  
  37.                 <ul>
  38.                     <li><a href="#">Branches</a></li>
  39.                     <li><a href="#">ATMs</a></li>
  40.                     <li><a href="#">Overseas Branches</a></li>
  41.                     <li><a href="#">Phone banking numbers</a></li>
  42.  
  43.                 </ul>
  44.                 </div><div class="bottom"></div>
  45.                 <h2>General Information</h2>
  46.                 <div class="back">
  47.                 <ul>
  48.                     <li><a href="#">Interest rates on FD</a></li>
  49.                     <li><a href="#">Service charges and fees</a></li>
  50.  
  51.                     <li><a href="#">Download Forms</a></li>
  52.                     <li><a href="#">FAQ's</a></li>
  53.                   </ul>
  54.                 </div>
  55.                 <div class="bottom"></div>
  56.     </div>
  57.  
  58.     <!-- end leftbar -->
  59.     <!-- start content -->
  60.     <div id="content">
  61.         <div class="post">
  62.              <h1 class="title">Employee Details</h1>
  63. <br><br>     <center><table>
  64. <tr>
  65. <td>
  66. <div>Employee No.</div>
  67. </td>
  68. <td><bean:write name="employeeDetailForm" property="empNo"/></td>
  69. </tr><tr></tr><tr></tr><tr></tr>
  70. <tr valign="top">
  71. <td>
  72. <div>Branch No.</div>
  73. </td>
  74. <td><bean:write name="employeeDetailForm" property="branchNo"/></td>
  75. </tr><tr></tr><tr></tr><tr></tr>
  76. <tr valign="top">
  77. <td>
  78. <div>First Name</div>
  79. </td>
  80. <td><bean:write name="employeeDetailForm" property="fName"/></td>
  81. </tr><tr></tr><tr></tr><tr></tr>
  82. <tr valign="top">
  83. <td>
  84. <div>Middle Name</div>
  85. </td>
  86. <td><bean:write name="employeeDetailForm" property="mName"/></td>
  87. </tr><tr></tr><tr></tr><tr></tr>
  88. <tr valign="top">
  89. <td>
  90. <div>Last Name</div>
  91. </td>
  92. <td><bean:write name="employeeDetailForm" property="lName"/></td>
  93. </tr><tr></tr><tr></tr><tr></tr>
  94. <tr valign="top">
  95. <td>
  96. <div>Department</div>
  97. </td>
  98. <td><bean:write name="employeeDetailForm" property="dept"/></td>
  99. </tr><tr></tr><tr></tr><tr></tr>
  100. <tr valign="top">
  101. <td>
  102.  
  103. <div>Designation</div>
  104. </td>
  105. <td><bean:write name="employeeDetailForm" property="desig"/></td>
  106. </tr><tr></tr><tr></tr><tr></tr>
  107.  
  108. <tr valign="top">
  109. <td>
  110.  
  111. <div>Address</div>
  112. </td>
  113. <td><bean:write name="employeeDetailForm" property="address"/></td>
  114. </tr><tr></tr><tr></tr><tr></tr>
  115.  
  116.  
  117. <tr valign="top">
  118. <td>
  119. </tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
  120. <tr></tr><tr></tr><tr></tr><tr></tr>
  121. <tr><td colspan=2>
  122. <center><a href="search employee.html">Search Employee</a></center>
  123. </td>
  124. </tr>
  125.  
  126. <tr></tr><tr></tr><tr></tr><tr></tr>
  127. <tr><td colspan=2>
  128. <center><a href="search customer.html">Search Customer</a></center>
  129. </td>
  130. </tr>
  131.  
  132. <tr></tr><tr></tr><tr></tr><tr></tr>
  133. <tr><td colspan=2>
  134. <center><a href="activate saving account.html">Activate Account</a></center>
  135. </td>
  136. </tr>
  137.  
  138. <tr></tr><tr></tr><tr></tr><tr></tr>
  139. <tr><td colspan=2>
  140. <center><a href="new employee.html">New Employee</a></center>
  141. </td>
  142. </tr>
  143.     </table></center>
  144. <br><br>
  145.         </div>
  146.     </div>
  147.     <!-- end content -->
  148.     <!-- start rightbar -->
  149.     <div id="rightbar" class="sidebar">                
  150.                 <h2>Login</h2>
  151.                  <div class="back">
  152.                 <form action="">
  153.     <center><table>
  154.     <tr ><td color=#000000>You have logged in as:</td></tr>
  155.     <tr><td><center>.......</center></td>
  156.     </tr>
  157.   <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
  158. <tr></tr><tr></tr><tr></tr><tr></tr>  
  159.     <tr><td><center><a href="#">logout<a><center></td></tr>
  160. <tr></tr><tr></tr>    </table></center>
  161.   </form>
  162.  
  163.                 </div><div class="bottom"></div>
  164.                 <h2>News</h2>
  165.                  <div class="back">
  166.                 <ul>
  167.                     <li><a href="#">Aliquam libero</a></li>
  168.                     <li><a href="#">Consectetuer adipiscing elit</a></li>
  169.                     <li><a href="#">Urnanet non molestie semper</a></li>
  170.                     <li><a href="#">Proin gravida orci porttitor</a></li>
  171.                 </ul>
  172.                 </div><div class="bottom"></div>
  173.     </div>
  174.     <!-- end rightbar -->
  175.     <div style="clear: both;">&nbsp;</div>
  176. </div>
  177. <!-- end page -->
  178.  <div id="footer">
  179.    <p>Copyright &copy; 2009. <a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a> | <a href="#" title="This page validates as XHTML 1.0 Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> | <a href="#" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a></p> 
  180.     <p>Design by <a href="#" title="CORPORATE BANK">Corporate Bank</a></p>
  181.  
  182. </div>
  183. </html>
  184.  
employeeDetailF orm.java

Expand|Select|Wrap|Line Numbers
  1. package com.kmg.employee;
  2. import org.apache.struts.action.ActionForm;
  3. public class employeeDetailForm extends ActionForm{
  4.  
  5.     private String empNo;
  6.     private String password;
  7.     private String fName;
  8.     private String mName;
  9.     private String lName;
  10.     private String dept;
  11.     private String desig;
  12.     private String address;
  13.  
  14.     public String getempNo() {
  15.         return empNo;
  16.     }
  17.     public void setempNo(String empNo) {
  18.         this.empNo = empNo;
  19.     }
  20.     public String getpassword() {
  21.         return password;
  22.     }
  23.     public void setpassword(String password) {
  24.         this.password = password;
  25.     }
  26.     public String getfName() {
  27.         return fName;
  28.     }
  29.     public void setfName(String name) {
  30.         fName = name;
  31.     }
  32.     public String getmName() {
  33.         return mName;
  34.     }
  35.     public void setmName(String name) {
  36.         mName = name;
  37.     }
  38.     public String getlName() {
  39.         return lName;
  40.     }
  41.     public void setlName(String name) {
  42.         lName = name;
  43.     }
  44.     public String getDept() {
  45.         return dept;
  46.     }
  47.     public void setDept(String dept) {
  48.         this.dept = dept;
  49.     }
  50.     public String getDesig() {
  51.         return desig;
  52.     }
  53.     public void setDesig(String desig) {
  54.         this.desig = desig;
  55.     }
  56.     public String getAddress() {
  57.         return address;
  58.     }
  59.     public void setAddress(String address) {
  60.         this.address = address;
  61.     }
  62.  
  63. }
  64.  
employeeDetailA ction.java

Expand|Select|Wrap|Line Numbers
  1. package com.kmg.employee;
  2.  
  3. import com.kmg.employee.employeeDetailForm;
  4. import com.kmg.services.*;
  5.  
  6. import java.sql.Connection;
  7. import javax.servlet.http.*;
  8. import javax.sql.DataSource;
  9. import org.apache.struts.action.*;
  10.  
  11. public class employeeDetailAction extends Action {
  12.  
  13.     public ActionForward execute(ActionMapping mapping, ActionForm form,
  14.             HttpServletRequest request, HttpServletResponse response)
  15.             throws Exception {
  16.         employeeDetailForm employeeDetailForm = (employeeDetailForm) form;
  17.         EmployeeDAO employeeDAO = new EmployeeDAO();
  18.         Employee employee = new Employee();
  19.  
  20.         Connection con = null;
  21.         DataSource ds = null;
  22.  
  23.         ds = getDataSource(request);
  24.         employee.setempNo(employeeDetailForm.getempNo());
  25.         String password = employeeDetailForm.getpassword();
  26.         String fName = employeeDetailForm.getfName();
  27.         String mName = employeeDetailForm.getmName();
  28.         String lName = employeeDetailForm.getlName();
  29.         String dept = employeeDetailForm.getDept();
  30.         String desig = employeeDetailForm.getDesig();
  31.         String address = employeeDetailForm.getAddress();
  32.         con = employeeDAO.getConnection(ds);
  33.         employee = employeeDAO.getRecord(con, employee);
  34.             employeeDAO.closeConnection(con);
  35.             return mapping.getInputForward();
  36.  
  37.     }
  38. }
  39.  
EmployeeDAO.jav a

Expand|Select|Wrap|Line Numbers
  1. package com.kmg.services;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.PreparedStatement;
  5. import java.sql.ResultSet;
  6. import java.sql.SQLException;
  7.  
  8. import javax.sql.DataSource;
  9.  
  10. public class EmployeeDAO {
  11.     public Connection getConnection(DataSource datasource) {
  12.         Connection con = null;
  13.         DataSource ds = datasource;
  14.         try {
  15.             con = ds.getConnection();
  16.         } catch (SQLException e) {
  17.             e.printStackTrace();
  18.         }
  19.         return con;
  20.     }
  21.  
  22.     public void closeConnection(Connection con) {
  23.         try {
  24.             con.close();
  25.         } catch (SQLException e) {
  26.             e.printStackTrace();
  27.         }
  28.     }
  29.  
  30.     public static Employee getRecord(Connection con, Employee employee) {
  31.         String qry = "select PASSWORD from EMP_MSTR where EMP_NO=?";
  32.         String password = null;
  33.         ResultSet resultSet = null;
  34.         try {
  35.             PreparedStatement pstat = con.prepareStatement(qry);
  36.             pstat.setString(1, employee.getempNo());
  37.             resultSet = pstat.executeQuery();
  38.             while (resultSet.next()) {
  39.                 employee.setpassword(resultSet.getString("PASSWORD"));
  40.                 employee.setfName(resultSet.getString("FNAME"));
  41.                 employee.setmName(resultSet.getString("MNAME"));
  42.                 employee.setlName(resultSet.getString("LNAME"));
  43.                 employee.setDept(resultSet.getString("DEPT"));
  44.                 employee.setDesig(resultSet.getString("DESIG"));
  45.                 employee.setAddress(resultSet.getString("ADDR"));
  46.             }
  47.         } catch (SQLException e) {
  48.             e.printStackTrace();
  49.         }
  50.  
  51.         return employee;
  52.     }
  53. }
  54.  
Employee.java

Expand|Select|Wrap|Line Numbers
  1. package com.kmg.services;
  2.  
  3. public class Employee {
  4.     private String empNo;
  5.     private String password;
  6.     private String fName;
  7.     private String mName;
  8.     private String lName;
  9.     private String dept;
  10.     private String desig;
  11.     private String address;
  12.     public String getempNo() {
  13.         return empNo;
  14.     }
  15.     public void setempNo(String empNo) {
  16.         this.empNo = empNo;
  17.     }
  18.     public String getpassword() {
  19.         return password;
  20.     }
  21.     public void setpassword(String password) {
  22.         this.password = password;
  23.     }
  24.     public String getfName() {
  25.         return fName;
  26.     }
  27.     public void setfName(String name) {
  28.         fName = name;
  29.     }
  30.     public String getmName() {
  31.         return mName;
  32.     }
  33.     public void setmName(String name) {
  34.         mName = name;
  35.     }
  36.     public String getlName() {
  37.         return lName;
  38.     }
  39.     public void setlName(String name) {
  40.         lName = name;
  41.     }
  42.     public String getDept() {
  43.         return dept;
  44.     }
  45.     public void setDept(String dept) {
  46.         this.dept = dept;
  47.     }
  48.     public String getDesig() {
  49.         return desig;
  50.     }
  51.     public void setDesig(String desig) {
  52.         this.desig = desig;
  53.     }
  54.     public String getAddress() {
  55.         return address;
  56.     }
  57.     public void setAddress(String address) {
  58.         this.address = address;
  59.     }
  60.  
  61. }
  62.  
struts-config.xml

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
  3.  
  4. <struts-config>
  5.   <data-sources>
  6. <data-source type="org.apache.commons.dbcp.BasicDataSource">
  7.     <set-property
  8.       property="driverClassName"
  9.       value="com.mysql.jdbc.Driver" />
  10.     <set-property
  11.       property="url"
  12.       value="jdbc:mysql://localhost:3306/bank_sys?autoReconnect=true" />
  13.     <set-property
  14.       property="username"
  15.       value="root"/>
  16.     <set-property
  17.       property="password"
  18.       value="hr"/>
  19.       </data-source>
  20.       </data-sources>
  21.    <form-beans>
  22.     <form-bean name="index1Form"
  23.                type="com.kmg.customer.Index1Form"/>
  24.  
  25.     <form-bean name="index2Form"
  26.                type="com.kmg.employee.Index2Form"/>
  27.  
  28.      <form-bean name="employeeDetailForm"
  29.                type="com.kmg.employee.employeeDetailForm"/>
  30.   </form-beans>
  31.  
  32.   <!-- Action Mappings Configuration -->
  33.   <action-mappings>
  34.     <action path="/index1"
  35.             type="com.kmg.customer.Index1Action"
  36.             name="index1Form"
  37.            input="/jsp/index1.jsp">
  38.            <forward name="accountDetail" path="/jsp/accountDetail.jsp"/>
  39.            </action>
  40.  
  41.            <action path="/index2"
  42.             type="com.kmg.employee.Index2Action"
  43.             name="index2Form"
  44.            input="/jsp/index2.jsp">
  45.            <forward name="employeeDetail" path="/jsp/employeeDetail.jsp"/>
  46.            </action>
  47.  
  48.            <action path="/employeeDetail"
  49.             type="com.kmg.employee.employeeDetailAction"
  50.             name="employeeDetailForm"
  51.            input="/jsp/employeeDetail.jsp">
  52.            </action>
  53.  
  54.   </action-mappings>
  55. </struts-config>
  56.  
  57.  

web.xml


Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  3.  
  4.  
  5.   <servlet>
  6.     <servlet-name>action</servlet-name>
  7.     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  8.     <init-param>
  9.       <param-name>config</param-name>
  10.       <param-value>/WEB-INF/struts-config.xml</param-value>
  11.     </init-param>
  12.     <init-param>
  13.       <param-name>debug</param-name>
  14.       <param-value>3</param-value>
  15.     </init-param>
  16.     <init-param>
  17.       <param-name>detail</param-name>
  18.       <param-value>3</param-value>
  19.     </init-param>
  20.     <load-on-startup>0</load-on-startup>
  21.   </servlet>
  22.   <servlet-mapping>
  23.     <servlet-name>action</servlet-name>
  24.     <url-pattern>*.do</url-pattern>
  25.   </servlet-mapping>
  26.   <welcome-file-list>
  27.     <welcome-file>/jsp/employeeDetail.jsp</welcome-file>
  28.   </welcome-file-list>
  29.  
  30.  
  31. </web-app>
  32.  
  33.  
I am sorry for posting all the code if its against the community guide lines.
But I really need help. I m SOO lost. How to display data retrieved from database using JSP file ?? Nothing is getting displayed when I run the JSP file.
Apr 13 '09 #1
12 77951
NitinSawant
270 Contributor
Okay, seems that you are newbie,

hey buddy you've already done the code for retrieving the data from database
checkout EmployeeDAO.jav a

Click: JSP Database Connectivity Code

hope it works
Apr 13 '09 #2
lifeisgreat20009
70 New Member
Yes I know the code to retrieve is there in that DAO class..
But how do I display it ?? I mean I have used the <bean:write > tag in my JSP file but its not displaying any value.

How can I write the code for DB connection and data retrieval again in my JSP when I have already made a separate class for that purpose i.e EmployeeDAO.jav a

Why is it not getting displayed ? Is there some problem with <bean:write > tag ?

Also when I hover mouse on <bean:write> tag
it says "unknown tag bean:write"

Whats wrong with it ?
Apr 13 '09 #3
NitinSawant
270 Contributor
At the top of the jsp page, just above the <html> tag write following lines:-

Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" %>
  2. <%@ taglib uri="/WEB-INF/struts-bean.tld"   prefix="bean" %>
  3.  
Apr 13 '09 #4
lifeisgreat20009
70 New Member
I just included the line below in my JSP file. It doesn't show the error "unknown tag bean:write" anymore.

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

Now that I am running my file it says :-
I know the error has to do something with name and property attributes I have given in the <bean:write> tag .. I am just not able to figure out. Please help me guys.


exception

org.apache.jasp er.JasperExcept ion: An exception occurred processing JSP page /jsp/employeeDetail. jsp at line 69

66: <td>
67: <div>Employee No.</div>
68: </td>
69: <td><bean:wri te name="employeeD etailForm" property="empNo "/></td>
70: </tr><tr></tr><tr></tr><tr></tr>
71: <tr valign="top">
72: <td>


Stacktrace:
org.apache.jasp er.servlet.JspS ervletWrapper.h andleJspExcepti on(JspServletWr apper.java:505)
org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 398)
org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:342)
org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :267)
javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:717)


root cause

javax.servlet.S ervletException : javax.servlet.j sp.JspException : Cannot find bean employeeDetailF orm in any scope
org.apache.jasp er.runtime.Page ContextImpl.doH andlePageExcept ion(PageContext Impl.java:852)
org.apache.jasp er.runtime.Page ContextImpl.han dlePageExceptio n(PageContextIm pl.java:781)
org.apache.jsp. jsp.employeeDet ail_jsp._jspSer vice(employeeDe tail_jsp.java:2 75)
org.apache.jasp er.runtime.Http JspBase.service (HttpJspBase.ja va:70)
javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:717)
org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 374)
org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:342)
org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :267)
javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:717)


root cause

javax.servlet.j sp.JspException : Cannot find bean employeeDetailF orm in any scope
org.apache.stru ts.taglib.TagUt ils.lookup(TagU tils.java:992)
org.apache.stru ts.taglib.bean. WriteTag.doStar tTag(WriteTag.j ava:227)
org.apache.jsp. jsp.employeeDet ail_jsp._jspx_m eth_bean_005fwr ite_005f0(emplo yeeDetail_jsp.j ava:294)
org.apache.jsp. jsp.employeeDet ail_jsp._jspSer vice(employeeDe tail_jsp.java:1 31)
org.apache.jasp er.runtime.Http JspBase.service (HttpJspBase.ja va:70)
javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:717)
org.apache.jasp er.servlet.JspS ervletWrapper.s ervice(JspServl etWrapper.java: 374)
org.apache.jasp er.servlet.JspS ervlet.serviceJ spFile(JspServl et.java:342)
org.apache.jasp er.servlet.JspS ervlet.service( JspServlet.java :267)
javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apr 13 '09 #5
lifeisgreat20009
70 New Member
Oh I just did that only..
Now its giving another error :(

I am sure it has something to do with the name and property attribute in the <bean:write> tag in my JSP file.
Apr 13 '09 #6
NitinSawant
270 Contributor
you have to define employeeDetailF orm on the jsp page
Apr 13 '09 #7
lifeisgreat20009
70 New Member
u mean i need to import that employeeDetails Form.java file in my JSP file or what ??

What do u mean by define ?
create object of it in JSP file ??

Seriously my mind has stopped working ...
I am struggling with this code for like 6-7 hours now and I need to complete it today only
Apr 13 '09 #8
lifeisgreat20009
70 New Member
ok in my DAO class I have retrieved all fields from the emp_mstr table in the getRecords() method and returning the Employee object ..

Now how do I use this object in my JSP page to display the values of all the fields that it contains ??

god I am sooo lost :(
Apr 13 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2076
by: Miki | last post by:
Hi. I have a IIS server with php3 installed. I have SQL server database and data stored in unicode format (nvarchar fields). In header of my php I have the meta: <meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">. I have the following problem: - I trie to do a query using ODBC (version 3.525.1022.0) and SQL
4
3925
by: Claudia Fong | last post by:
Hi, I have a form where I need to display the data of a department that stores in a access db. When I first load the form it will call a function name loaddata which will get the first record from the db and then display for the user: oleDbConnection1.Open();
1
3243
by: funcSter | last post by:
I want to retrieve data from an Excel file like how I would with a database. I understand that I would have to use OLE DB. Somehow I think I cannot get the connection string right, as the bit of code fails at "objConn.Open()" with the error: System.Data.OleDb.OleDbException: Could not find installable ISAM. Can somebody please help me out?...
5
2420
by: ggk517 | last post by:
We are trying to develop an Engineering application using PHP, Javascript with Informix as the back-end. Is it possible to retrieve data using Javascript but by accessing the Database. Say somebody enters part_no, than using Javascript is it possible to connect to the part master and retrieve the division and desc information? I am not...
1
6520
by: RajithaV | last post by:
Hi, I am developing a web application using ASP.Net I am using sql server.My coding is in VB.net I want to know how to move data from excel file into the Database. I also need to know how to retrieve data from Database and show it in excel file. Thanks in advance for any replies. rajitha
1
4913
by: Ryan | last post by:
Hi, I'm trying to do retrieve some data from a table where the content is in Greek, however, the query is not working. It's a very simple statement, but I'm missing something. Here is the table... if exists (select * from dbo.sysobjects where id = object_id(N'.
5
2077
by: fruityfreak | last post by:
I would like to know how to I retrieve information from another database table... Instead of keying in manually, I would like to retrieve data directly from the logged in user row. For the user table, i have outletid in it. Outlet ID: <input type="text" name="outletid"> (Manually) Outlet ID: <?php echo $row; ?> (Is this how it looks like...
0
2516
by: ghjk | last post by:
I want to insert web application data to mysql database. I'm using struts, jsp and hibernet.This is my action class. public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { MemberActionForm formbean = (MembeActionForm)...
0
7584
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8023
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7879
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6129
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5144
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
828
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.