|
yup i am using a win 7. How shld i go abt solving it?
http://img600.imageshack.us/img600/8999/capture1ml.png[^]
Right now when i run the startNetworkServer, there isnt any access deny but when i try to connect to the database, it will have the error shown above.
I have a local database deployed on my local pc. is there any way i can connect my laptop to the local database from my local pc so that i need not create one for my laptop but still able to use the database?
modified on Wednesday, January 12, 2011 4:01 AM
|
|
|
|
|
The server is not accepting your connection... why? is it the right address?
regards
Torsten
I never finish anyth...
|
|
|
|
|
i manage to connect to my desktop's local connection already
|
|
|
|
|
I'm a newbie....if given this snippet of code
Sam.Leg.Hair.Cell
how am I suppose to know which one below is it just by looking at it
1. Sam.Leg.Hair is the namespace and Cell is the name of an object
2. Sam.Leg is the namespace and Hair is an object which contains the object Cell
3. Sam is the namespace and Leg contains the object Hair which contains the object Cell
4. Sam is an object that contains an object Leg which contains and object Hair which contains an object Cell
|
|
|
|
|
It ain't 2,3,4; if you must pick one it would be 1, although strictly speaking it would then be a namespace followed by a class name (or type name), not an object. And it really depends on context, your "snippet" isn't a real snippet, where is that string located? in a namespace statement? in a class reference?
I suggest you read an introductory book on Java if you're interested or need to know this (and much more). I also think namespaces and class names by convention use lower-case in Java.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I also think namespaces and class names by convention use lower-case in Java.
NO! Namespaces are lower-case, Objects are definitely starting upper-case!
@ nic
The namespace or package declaration divides your application into different parts.
Normally you will have some kind of user interface(UI or GUI if it is a graphical one), some services and some kind of database.
These three parts have their own namespaces:
package app.gui;
package app.gui.page;
package app.gui.page.view;
package app.database;
package app.database.type.person;
package app.database.type.person.extremity;
package app.services;
package app.services.actions;
package app.services.status;
The GUI gets it's data, that is to be shown/modified, from the services. Changes are submitted to the services.
The database is served/controlled by the services. The database package also has different packages underneath to organize the objects.
In this case the classes/ objects in the database package do not know anything about the GUI - and the GUI doesn't need to know anything about the database. The services is some kind of agent / mediator, which is positioned in the middle to serve (what is probably the cause it is called "service" ...).
So declaring packages will give you more control on your code and will organize your app.
You can read more about this basic organizing stuff - try to search for MVC (Model-View-Controller).
regards
Torsten
I never finish anyth...
|
|
|
|
|
Actually it could be any of the above, 1, 2, 3 or 4, allowing for the messed up naming convention.
Example: java.util.Map.Entry is a class called Entry inside a class called Map inside a package called java.util.
Inner classes can contain nested inner classes, that is legal in Java, although not good design. So you could have mypackage.A.B.C or even A.B.C.D if A is located in the default package. Most Java programmers seeing Able.Baker.Charlie.Delta would see it as four class names because of the naming convention that classes start with uppercase characters and packages start with lower case.
Also, Java packages are not hierarchical, so the java package does not really contain the util package. They are two separate packages, one called java, one called java.util. If you are using reflection, you can get a Package object that represents a package, but there is no way to get sub-packages since there is no such concept in the Java language itself. (OK, you can list all the packages and parse through them by name yourself which is how Eclipse and NetBeans do it.) Java files (source and class files) are stored in a hierarchical file structure, but the actual packages themselves are not seen as hierarchies by the JVM at runtime. The pseudo-hierarchy of packages is there for human convenience, not for the compiler or JVM.
|
|
|
|
|
I stand corrected. Forgot about inner classes. Thanks.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hi,
In installshield, i am calling the third party application "how to findout the application installed or not?". In some cases i have to handle that operations like cancel the setting and finish application. How to findout?
Any body known.....?please give me the reply.......
thank u.
|
|
|
|
|
You have posted this question in 6 six different forums today, which should guarantee that nobody will pay you much attention other than pointing you to the forum guidelines. If you have a serious question please find the most appropriate forum and post it only once.
I must get a clever new signature for 2011.
|
|
|
|
|
thank u,
for the given guide lines, in before i don't know.
|
|
|
|
|
But now you do know, you keep doing it. See here
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I am now working on a project that requires me to use netbeans, glassfish, javadb to create a jsp file.
I have build a table in the jsp file which display the database values which allows the user to add and delete values by using textboxes and values will be updated to the database.
For example right now the table contains an id 3 however when i try delete it, i am able to but when i would want to add back the id 3 i am unable to. why is this so?
And how can i compare the values of the textboxes with the table to check if the values keyed in textboxes does not appears in the table twice?
Needing urgent help, hope to hear form you all soon.
|
|
|
|
|
pancakeleh wrote: i am able to but when i would want to add back the id 3 i am unable to. why is this so?
In general deleting a record from a database does not actually remove the record but just marks it as deleted. You will have to run some sort of purge process to remove all details of the record in question - check your documentation.
pancakeleh wrote: And how can i compare the values of the textboxes with the table to check if the values keyed in textboxes does not appears in the table twice?
I expect you just need to run a query on the key in question, if it exists you will get the record, if it does not exist you will get some error code - check your documentation.
pancakeleh wrote: Needing urgent help
Nothing on CodeProject is urgent; other than feeding the hamsters.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
i am so new to java as well as to netbeans and sql.
do i write my query like this?
ResultSet resultSet = statement.executeQuery("SELECT COUNT(INCIDENTID) FROM INCIDENTDATA");
care to explain more about the purge process?
|
|
|
|
|
Sorry but I'm not an SQL or database expert; like I said you need to check your documentation. I find it difficult to see how you can be writing a Database application if you do not understand the basics.
I must get a clever new signature for 2011.
|
|
|
|
|
Post some code snippets, otherwise it's very hard for us to guess what's working what's not.
--
Arman
|
|
|
|
|
try{
Connection con = DriverManager.getConnection( );------------------------> Not sure what to include here.
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT INCIDENTID FROM INCIDENTDATA");
ArrayList allResults = new ArrayList();
while (rs.next()) {
int incidentID = rs.getInt("INCIDENTID");
allResults.add(incidentID);
}
}
catch (Exception ex) {
log("ErrorDescription", ex);
error(ex.getMessage());
}
My code are as shown above.
i am unsure of how to make use of sql to check/compare values in the table and with the values the user keyed into the textboxes.
|
|
|
|
|
I really think you should do some serious Database/SQL study before attempting to go any further with this project or you are likely to get into serious difficulties. Take a look at the tutorials here[^] for a good starter.
I must get a clever new signature for 2011.
|
|
|
|
|
I'm not sure what you mean "... check/compare values in the table and with the values the user keyed into the textboxes."
But I guess you need to get the value from the textbox and write your sql like so:
String myKey = myTextBox.getText();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT INCIDENTID FROM INCIDENTDATA WHERE PERSONNAME = '" + myKey + "'");
--
Arman
|
|
|
|
|
Arman S. wrote:
ResultSet rs = stmt.executeQuery("SELECT INCIDENTID FROM INCIDENTDATA WHERE PERSONNAME = '" + myKey + "'");
Please do not encourage people to use constructs that allow for SQL injection; it is almost guaranteed to compromise their entire system.
I must get a clever new signature for 2011.
|
|
|
|
|
lol, the OP should first realize the existence of such a construct and then understand it's disadvantages.
Thanks!
--
Arman
|
|
|
|
|
Arman S. wrote: the OP should first realize the existence of such a construct and then understand it's disadvantages.
Not quite; we are supposed to be helping people to learn. Your answer offers the OP the chance to make a big mistake, without advising how to avoid it.
I must get a clever new signature for 2011.
|
|
|
|
|
Agreed - generally speaking. But not quite, for this concrete situation.
If it were so, why wouldn't you go ahead and explain the whole theory behind secure Web development to the OP?
Common sense tells me, that you (and I) didn't do it as:
* We are not sure if it will solve a bit of OP's problem
* We are not sure if OP is even doing e.g. Web
* We are not sure if the proposed solution above (by myself) even targets the right problem (because of poor explanation of the problem)
My belief is that for beginners (assuming OP is) what matters most is the tangible result, something they can see and the feeling that something is working.
--
Arman
|
|
|
|
|
Arman S. wrote: Agreed - generally speaking. But not quite, for this concrete situation.
If it were so, why wouldn't you go ahead and explain the whole theory behind secure Web development to the OP?
Common sense tells me, that you (and I) didn't do it as:
* We are not sure if it will solve a bit of OP's problem
* We are not sure if OP is even doing e.g. Web
* We are not sure if the proposed solution above (by myself) even targets the right problem (because of poor explanation of the problem)
My belief is that for beginners (assuming OP is) what matters most is the tangible result, something they can see and the feeling that something is working.
Which would matter only if any of that is relevant.
One uses parameters (bind variables) in SQL because it prevents injection attacks AND because it correctly deals with other issues in correctly constructing SQL. And this applies to any programming language that supports such usage.
There are very few cases where one should be using string concatenation without using parameters. Even when concatenation is used in constructing SQL, such as with variable list productions, parameter usage is still better.
So you are presenting a technique that one should almost never use.
Your rationalizations do not change that.
And by the way SQL injection attacks are not something that are only relevant in Web apps.
|
|
|
|