|
sir im using two different table table1 and table2
in table1 im storing user details and
table2 storing username and password .
when the user login with table2. he want to same person details only .
how it is passable please help me.
|
|
|
|
|
Does this have anything to do with Java? If so please explain exactly what the issue is.
|
|
|
|
|
Use appropriate forum to post your questions.Please see this[^] before posting another question
In both tables ,the common id will be USERID(assumption).Use INNERJOIN to join the tables by the common column(USERID).
Check these to know about joins:
Joining Tables in SQL[^]
Visual Representation of SQL Joins[^]
You have to learn to think like a computer or teach him to think like a human.
-Kornfeld Eliyahu Peter
|
|
|
|
|
Here is the question:
12-player are in a 6-day competition. The competition have 6 different games. the rule is:
1. Every player must participate all 6 games.
2. Each player can only play the same game ONCE.
3, Each player can only play with the same opponent ONCE.
right now I use two method "isPlayed()" and "isPlayedWith()" to set players in a loop, but it doesn't work. I guess I have to some other way. But right now I have no clue how to design the algorithm. please help me out. I can write code myself, I just need to learn HOW.
Thank you very much
|
|
|
|
|
There is a forum for Algorithm questions. Alternatively you could show the relevant parts of your code and explain what is meant by:
Member 10409221 wrote: but it doesn't work
|
|
|
|
|
Hi, relatively new to java, and wondering how I should make the following construction:
Got 3 tables let's call them A, B & C.
Reverse engineered those with Hibernate. C refers to A & B with foreign keys, no other relations.
Hibernate translates those foreign keys as getA() and setA(A a) in my C class.
So how do I make a query that says I need all C where A.Id = 1 ?
Here is what I got so far, but generates an error: invalid path null.A
Query q = session.createQuery("select C from A inner join C.A where A.Id="+String.valueOf(a.getId()));
|
|
|
|
|
Looks like your String.valueOf(a.getId()) expression is not generating anything. Use your debugger to see what is happening.
|
|
|
|
|
that expression is working fine, it's the only thing on that line that IS working.
Based on the error I get, it looks like the join isn't working good. But I don't have enough knowledge to fix it.
|
|
|
|
|
I'm afraid that's an SQL issue, nothing to do with Java.
|
|
|
|
|
It's a Hibernate issue which is part of Java, so I think otherwise. But let's ask the question differently:
I want to get a list of type C where the property of type A matches a value of type A.
Or put in practice: I have a combobox filled with a list of type A. Type C has 2 properties: a & b. a is of type A, b is of type B. Now I want a list of type C where property a matches the value of the combobox.
How would you do this with using Hibernate?
|
|
|
|
|
Sorry, I don't know Hibernate.
|
|
|
|
|
Dated: 29th April 2014
To,
The Managing Director
Southtech Limited,
Plot -1, Road -13, Sector -1,
Uttara Model Town, Dhaka 1230
Subject: Resignation Letter for the position of Ascend Programmer.
Dear Sir,
With due respect, I would like to inform you that, I have some problem to continue my job in your organization and have intention to leave my position as Ascend Programmer from your Ascend ISS Department in Southtech Limited.
It was a great honor for me to work with you. Due to family crisis, financial and physical problem, I am unfitted in this job position. Right now, no pending projects are dependent on me. I feel tremendous problem to continue my work. Therefore, I would like to request you to relieve me of my duties immediately. Please be assured that I will do all I can to assist in the smooth transfer of my responsibilities before leaving.
I wish both of you and Southtech Limited, every good fortune and I would like to thank you for having me as a part of your team.
Best regards,
Mostafizur Rahman
Ascend Programmer
Pin: 641
Souttech Limited
Contact: +8801675876752
Email: mostafizur.cse@gmail.com
C.C.:
1. Md Zayed Zulfikar, Chairman, Southtech Limited, Sector -1, Uttara Model Town, Dhaka 1230
2. Md. Shajibul Hussain Talukder, Senior software developer, Ascend ISS, Southtech Limited, Sector -1, Uttara Model Town, Dhaka 1230
3. Human Resource Department, Southtech Limited, Sector -1, Uttara Model Town, Dhaka 1230
how can read all line in java with formating in above message
|
|
|
|
|
Given that we have no idea what formatting you are talking about, it is impossible to answer. Please explain the format used in the file.
|
|
|
|
|
I think you should use BufferedReader/Writer. According what i saw, it looks like simple text.
PS: My English's not good, please ignore my mistake.
|
|
|
|
|
private List<Patienthealthdata> patientHealthDataList = new ArrayList<Patienthealthdata>();
patientHealthDataSet = medicalHistoryService.getLatestMedicalHistoryDataAttributes(patient);
String groupName = patientHealthData.getHealthdata().getHealthdatagrouplinks().iterator().next().getHealthdatagroup().getName().trim();
if (groupName.equals(Constants.HELTH_GROUP_BMI)) {
if (patientHealthData.getHealthdata().getName().contains("Height (ft)")) {
for (Entry<Integer, String> entry : heightMap.entrySet()) {
if (entry.getKey() == 1) {
valHeightFt = entry.getValue();
}
if (entry.getKey() == 2) {
valHeightInch = entry.getValue();
}
int indexInch = valHeightInch.indexOf('\'');
if (indexInch > 0) {
valHeightInch = valHeightInch.substring(0, indexInch);
}
int indexFt = valHeightFt.indexOf('\'');
if (indexFt > 0) {
valHeightFt = valHeightFt.substring(0, indexFt);
}
if (!valHeightFt.equals("") && !valHeightInch.equals("")) {
newValue = valHeightFt + "'" + valHeightInch + "\"";
patientHealthData.setHealthDataValueDisplay(newValue);
}
}
patientHealthDataList.add(patientHealthData);
}
|
|
|
|
|
Not sure what the question is but TreeMap might be the answer since it is a sorted collection.
|
|
|
|
|
Any body can give me java code similar to ASP.net
ISNOTPOSTBACK
so that I can fetch / fill my current page values without refreshing the page and If I filled the half of my form they will not get effected
|
|
|
|
|
Hello,
There are multiple ways
- Using the JSTL tag libraries in plain JSP
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
...
<input id="txtFName" name="txtFName" value="${fn:escapeXml(param.txtFName)}">
...
<textarea id="txtLName" name="txtLname">${fn:escapeXml(param.txtLName)}</textarea> - Using Spring Framework & Spring Form Tag Library
Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
I want to display notification (messages/data updates) by other users on the my current loginuser page.
example as soon we get mail, our page will change update new mails without refreshing entire page.
Please help me
|
|
|
|
|
1: procedure AllocateVM(VMList)
2: i←1;
3: while VMList ≠ ɸ do
4: HostId ←RankingAlgo(HostList; Requirmenti; Rank);
5: HostHostId←VMi ;
6: i←i + 1;
7: end while
8: end procedure
1: procedure RankingAlgo (HostList; Requirment; Rank)
2: for each Host € HostList do
3: if Host Satisfies the Requirments then
4: add (MemberList;Host);
5: end if
6: end for
7: PriorityList← SortByRank(MemberList;Rank);
8: AllocatedHost←PriorityList(1);
9: Return AllocatedHost;
10: end procedure
|
|
|
|
|
There is nothing in there that requires anything more than a understanding for the java language (no API needed.)
So the idea is learn basic java and then write the code.
|
|
|
|
|
i want to create a java project:
Create objecte
create two function WriteXml () and ReadXml !
writeXml(): save informayion to xml file
ReadXml(): Read information frm xml file and show!
i use jdom 2.02
i do on 1 file "WriteReadXml.java"
-----code
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.Text;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
public class ReadWriteXml {
public static void main (String[] args){
writeXml ();
}
private static void ReadXml(){
SAXBuilder builder = new SAXBuilder();
Document readDoc = null;
try {
readDoc = builder.build(new File("./src/jdomMade.xml"));
} catch (JDOMException | IOException e) {
e.printStackTrace();
}
System.out.println("Root:" + readDoc.getRootElement());
System.out.println("Show:"+
readDoc.getRootElement().getChild("show").getChildText("name"));
System.out.println("show ID :" + readDoc.getRootElement().getChild("show").getChild("name").getAttributeValue("show_id) + "));
Element root = readDoc.getRootElement();
for (Element curEle : root.getChildren("show"));{
Element curEle = null;
System.out.println("show Name : " +
curEle.getChildText("name"));
System.out.println("show ID : "
+curEle.getChild("name").getAttributeValue("show_id"));
System.out.println(" on " +
curEle.getChildText("network")+"in the");
System.out.println(curEle.getChild("network").getAttributeValue("country"));
}
}
private static void writeXml () {
try{
Document doc = new Document();
Element theRoot = new Element ("tvshows");
doc.setRootElement(theRoot);
Element show = new Element ("show");
Element name = new Element ("name");
name.setAttribute("show_id","shows_001");
name.addContent(new Text ("Game program"));
Element network = new Element ("network");
network.setAttribute("C***ry","TN");
network.addContent(new Text ("TNN"));
show.addContent(name);
show.addContent(network);
theRoot.addContent(show);
Element show2 = new Element ("show");
Element name2 = new Element ("name");
name2.setAttribute("show_id","shows_002");
name2.addContent(new Text ("Kids prgram"));
Element network2 = new Element ("network");
network2.setAttribute("C***ry","FR");
network2.addContent(new Text ("TNT"));
show2.addContent(name2);
show2.addContent(network2);
theRoot.addContent(show2);
XMLOutputter xmlOutput = new XMLOutputter (Format.getPrettyFormat());
xmlOutput.output(doc, new FileOutputStream(new File (".src/jdomMade.xml")));
System.out.println("Wrote to file");
}
catch (Exception ex){
ex.printStackTrace();
}
}
} ----
_________________________
error is :
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at ReadWriteXml.writeXml(ReadWriteXml.java:84)
at ReadWriteXml.main(ReadWriteXml.java:16)
tnx for answer me http://s.codeproject.com/script/Forums/Images/thumbs_up.gif
http://s.codeproject.com/script/Forums/Images/smiley_doh.gif
|
|
|
|
|
Hello,
The problem is in following line
xmlOutput.output(doc, new FileOutputStream(new File (".src/jdomMade.xml")));
Please correct it to
xmlOutput.output(doc, new FileOutputStream(new File ("./src/jdomMade.xml")));
Without this you are probably going to get FileNotFoundException.
Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
A jsp project is developed by using Tomcat server.Now I want to install the same project in Jboss server. Can anyone tell me the steps to do????
My database is Microsoft SQL server 2008 R2
|
|
|
|
|