16,018,650 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by User-10031173 (Top 37 by date)
User-10031173
20-Dec-13 7:45am
View
in rm_price table sid is also there i forgot to mention sid
User-10031173
20-Dec-13 7:44am
View
sid is the reference key
User-10031173
20-Dec-13 5:33am
View
but its giving error like:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'SELEC
T @maxprice = MAX(unitprice) FROM rm_price
SELECT rmname, @minprice as MinP' at line 2
User-10031173
20-Dec-13 5:21am
View
I tried the below query. giving correct result, but i need current unitprice and respective inv_date,sname group by sname. how can i place these in the follwing query. please help me
select r.sid,r.rmname,r.inv_date as dateofmax,
r.unitprice as maxprice,
r3.inv_date as minofdate,r3.unitprice as minprice,
r.unitprice-r3.unitprice as pricediff
from rm_price r
left join rm_price r2 on r.rmname=r2.rmname and r.unitprice<r2.unitprice
left="" join="" rm_price="" r3
="" on="" r.rmname="r3.rmname" and="" r3.unitprice<="r.unitprice
" r4=""
="" r3.unitprice="">r4.unitprice
where r2.unitprice is null
and r4.unitprice is null group by r.rmname \G
User-10031173
20-Dec-13 5:16am
View
its correct.
also i need current price and respective date,sname and group by suppliername for above query. where can i place these columns. i tried many ways but giving wrong results.
User-10031173
11-Oct-13 8:54am
View
here we hosted our webapplication. but we are unable to find the log4j generated file path. What is the location of this properties file
User-10031173
11-Oct-13 2:55am
View
yes.. when i click on comment script is ruuning. Actually the script have to be load afer edit tand submit the comment. for first time its working. but for second time the script is loading before update comment.
User-10031173
10-Oct-13 3:09am
View
can we update the data without reloding the page using ajax.
i have used ajax but its not working where the problem please suggest me here is my code
<script type="text/javascript">
$(document).ready(function() {
$(".aaa input:image").click(function(e) {var id=$(this).attr('id');
e.preventDefault();
var cid=$("#"+id+"cid").val();
alert(cid);
var comment = $("#"+id+"c").val();
var email=$("#email").val();
var gid=$("#gid").val();
var postid=$("#postid").val();
var value ='comment='+comment+'&cid='+cid+'&email='+email+'&gid='+gid+'&postid='+postid;
$.ajax({
url: "update.jsp",
//type: "post",
data: value,
cache: false,
success: function(data) {
alert("ok");
$("#comment_display").html(data).slideDown('fast');
}
});
});
});
</script>
and my jsp page is
<%
System.out.println("comment information");
int cid1=Integer.parseInt(request.getParameter("cid"));
System.out.println("comment information cid is..............."+cid1);
int gid1=Integer.parseInt(request.getParameter("gid"));
int postid1=Integer.parseInt(request.getParameter("postid"));
String email=request.getParameter("email");
String comment=request.getParameter("comment");
try{
Connection con=(Connection) new DB2Connection().getDatabaseConnection();
System.out.println("connection test in update.jsp");
Statement st=con.createStatement();
PreparedStatement ps=con.prepareStatement("update user_comment set comment=? where cid=?");
System.out.println("after query in update.jsp");
ps.setString(1,comment);
ps.setInt(2,cid1);
int k= ps.executeUpdate();
if(k>0){
Statement st1=con.createStatement();
ResultSet rs1=st1.executeQuery("select * from user_comment where gid='"+ gid1 + "' and postid=" + postid1);
System.out.println(gid1+"comment information");
while (rs1.next()) {
String msg = rs1.getString("comment");
String user = rs1.getString("email");
int cid=rs1.getInt("cid");
int postid=rs1.getInt("postid");
int grid=rs1.getInt("gid");
%>
<input type="hidden" name="cid" value="<%=cid %>" id="cid<%=cid%>"/>
<input type="hidden" name="pid" value="<%=postid %>" id="pid<%=postid%>"/>
<input type="hidden" name="grid" value="<%=grid %>" id="grid<%=postid%>"/>
<input type="hidden" name="email" value='<%=session.getAttribute("email")%>' id="email" />
<div id="comment_display">
<p
style="border:0px solid skyblue;width:auto;height:auto;font-weight: bolder;" id="p"><%=user%>
:
<%=msg%>
<img alt="delete" src="images/Edit.png" height=15 width=15 style="cursor:pointer;" id="edit" />
<img alt="delete" src="images/cancel-icon.png" height=15 width=15 style="cursor:pointer;" önclick="deletecomment('cid<%=cid%>','pid<%=postid%>','grid<%=postid %>','email','review_display<%=postid%>');">
</p>
</div>
<%
}
}
}
catch(Exception e){
}
%>
User-10031173
10-Oct-13 3:07am
View
thanks for ur its works perfectly
User-10031173
7-Oct-13 5:58am
View
when edit the existed comment then press on enter key the edited comment need to be updated in database and in application page
User-10031173
7-Oct-13 5:56am
View
sorry... my requirement is just like in facebook we can delete/edit the comments. In facebook when we mouse over on the comment it shows edit/ delete drop down will appear. when we click on edit button the comment become in edit view. same functionality i want include in my project.
User-10031173
20-Sep-13 8:08am
View
i have solved myself
Just we need to change the character set to utf8 and collation to utf8_unicode_ci
when we create the table.
and for displaying the contents we need to change the follwing to tags
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"autoFlush="true"%>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
User-10031173
17-Sep-13 3:24am
View
yes i did what u said. But text is not converted to edited format. how can i copy only required text from this image pdf
User-10031173
17-Sep-13 1:37am
View
yes ocr
User-10031173
16-Sep-13 7:10am
View
java
User-10031173
16-Sep-13 6:39am
View
yes i have used. but my requirement is like this
http://in.omg.yahoo.com/photos/less-famous-star-kids-slideshow/ahaan-shetty-photo-1378354044798.html
when i click on particular image it shows slide show of respective celebriti images.
User-10031173
29-Aug-13 3:07am
View
how to use this localization for my website
User-10031173
19-Aug-13 8:43am
View
i have used the following method, am using netbeans IDE.
<pre>
public static List getImages(){
List l1=new ArrayList();
File dir = new File("../build/web/politicalimages");
// array of supported extensions (use a List if you prefer)
final String[] EXTENSIONS = new String[]{
"gif", "png", "jpg" // and other formats you need
};
// filter to identify images based on their extensions
FilenameFilter IMAGE_FILTER = new FilenameFilter() {
public boolean accept(final File dir, final String name) {
for (final String ext : EXTENSIONS) {
if (name.endsWith("." + ext)) {
return (true);
}
}
return (false);
}
};
if (dir.isDirectory()) { // make sure it's a directory
for (final File f : dir.listFiles(IMAGE_FILTER)) {
BufferedImage img = null;
try {
img = ImageIO.read(f);
// you probably want something more involved here
// to display in your UI
String imagepath= f.getName();
System.out.println("image path in dao class......."+imagepath);
l1.add(f);
}
catch (final IOException e) {
// handle errors here
}
}
}
return l1;
}
</pre>
but it returns null when i get the list values. how can i give netbeans folder path.
User-10031173
10-Aug-13 0:37am
View
For play icon i want popup and for another link is to be redirect to another jsp page
User-10031173
8-Jul-13 6:27am
View
it should be blank.(mysql)
User-10031173
8-Jul-13 4:07am
View
movie_image and Movie_name
User-10031173
8-Jul-13 3:29am
View
select music.movie_name,music.movie_image,music_details.songtitle from music join music_details on music.musci_id=music_details.music_id group by music_id .
User-10031173
8-Jul-13 2:55am
View
i have already use distinct keyword but is not solve my problem.
User-10031173
8-Jul-13 2:43am
View
Ok. I will try and let u know
User-10031173
8-Jul-13 1:31am
View
Thanx for rply.
but am developing one website which is related to music. so i need to add players which will support all audio and video files extensions. which one is better. Am totally new to this concept
User-10031173
3-Jun-13 6:11am
View
Deleted
i have two jsp pages:
form.jsp:
<html>
<head><title>Upload page</title></head></p> <p><body>
<form action="fileupload.jsp" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table border="2">
<tr>
<td align="center">
Multipale file Uploade</td>
</tr>
<tr>
<td>
Specify file: <input name="file" type="file" id="file">
<td>
</tr>
<tr>
<td>
Specify file:<input name="file" type="file" id="file">
</td>
<tr>
<td>
Specify file:<input name="file" type="file" id="file">
</td>
</tr>
<tr>
<td align="center">
<input type="submit" name="Submit" value="Submit files"/>
</td>
</tr>
</table>
</form>
</body>
</html>
</pre></pre>
fileupload.jsp:
<pre lang="java">
<table border="2">
<tr>
<td>
Your files uploaded
</td>
</tr>
<%
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
System.out.println("isMultipart="+isMultipart);
System.out.println(config.getServletContext());
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
System.out.println(upload.parseRequest(request));
List items=null;
try {
items = upload.parseRequest(request);
} catch (FileUploadException e) {
e.printStackTrace();
}
Iterator itr = items.iterator();
while (itr.hasNext()) {
FileItem item = (FileItem)(itr.next());
out.println("itr");
if (item.isFormField()) {
try{
String field=item.getFieldName();
String value=item.getString();
System.out.println("field="+value);
}
catch(Exception e){}
}
else {
out.println("nor done");
String itemName = item.getName();
out.println("1done");
File savedFile = new File("C:/images/images/"+itemName);
item.write(savedFile);
Connection connection = null;
String connectionURL = "jdbc:mysql://localhost:3306/test";
PreparedStatement psmnt = null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "root", "root");
psmnt = connection.prepareStatement("insert into file(file_path) values(?)");
psmnt.setString(1, savedFile.getPath());
int s = psmnt.executeUpdate();
if(s>0){
System.out.println("Uploaded successfully !");
}
else{
System.out.println("Error!");
}
}
catch(Exception e){
e.printStackTrace();
}
}
out.println("done");
}
%>
</table>
</pre>
but it will save the file paths in database as following:
----------------------------------------------------------|-------|
file_path | id |
---------------------------------
User-10031173
28-May-13 2:22am
View
i got the solution. we can do like this
<html:link page="/saleget.do?sale=Home for sale">Home For sale</html:link>
in formbean class we can define like this..
private String sale;
set()..;
get()..
User-10031173
25-May-13 3:29am
View
hi..
how can i get original url in struts tiles. we can forward to many pages. but in browser it ll display only one url like ...../*.do. but how can i get original urls of forward pages. here i tried with the following but gives null values
code:
request.getAttribute("javax.servlet.forward.query_string)
request.getAttribute(Globals.ORIGINAL_URI_KEY)).toString()
request.getAttribute("javax.servlet.forward.request_uri")
User-10031173
24-May-13 6:43am
View
ok thank u
User-10031173
24-May-13 4:45am
View
thanks for your support. But my problem is not that one. Am getting ip address of client's. but i need implement one generic function for capturing website visitors data further i need to store data in database.I meant to say in side my website what visitors are doing that i need to get into my function. Like one webservice method LogthisEvent(website Name, IpAddress, Event performed, Date and time). then i log this information into DB.
User-10031173
24-May-13 0:12am
View
i have capture visitors ip address by using the following.
InetAddress localhost = InetAddress.getLocalHost();
System.out.println(" IP Addr: " + localhost.getHostAddress());
now ineed to record website visitors data using visitor's ip address. how can i do this one
User-10031173
23-May-13 8:14am
View
yes i know but. i tried with java script.. but its not suitable for my application. now i want to achieve this one using java
User-10031173
23-May-13 7:10am
View
is there any way to create cookies using client ip address. further i need to store client's visited data in database for future purpose
User-10031173
23-May-13 7:06am
View
i have used one javscript file for creating cookies. but i dint how to apply in my project and its working environment
User-10031173
23-May-13 7:04am
View
its giving my system env varibales details. is there any way to get client ip address along with data about what client visited in my site
User-10031173
22-May-13 6:13am
View
just send me the steps for creating cookies , and how can i store it ,what i need to store in database regarding cookies
User-10031173
22-May-13 3:00am
View
thanks for reply. i ll try it.
Show More