StephNicolaou 32 Posting Whiz in Training

Under the form load, you can enter:

Me.ComboName.RowSource = "SELECT [TBL].[IDField1], [TBL].[NameField2] FROM [TBL] IN '" & DBpath & "' ORDER BY [IDField1];"

Or have you solved this thread completely? Mark as solved if so...

StephNicolaou 32 Posting Whiz in Training

Actually go/log into the database to see if primary keys are set, show that print screen. When you wrote your queries, you included 'int not null' and primary key(whatever) lines (?).

If then Netbeans is still not showing the primary keys, I would code the database link as it must be the Netbeans settings playing up. I haven't heard about Ionbank so try selecting other data sources to check whether it's happening for each type.

JDBC connection setup
http://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/

StephNicolaou 32 Posting Whiz in Training

I would say that once 5 is decremented to 0, it stays as 0 as all you have is 'return 0' doing nothing else, and you have no system exit at that point.

StephNicolaou 32 Posting Whiz in Training

The problem may be with s.name, try using a variable without the dot.

StephNicolaou 32 Posting Whiz in Training

To display only one particular type of news articles in a drop down menu, you need to ensure you have a category table and the news_category compound table in your database where all of the news articles are linked to a category.

Then you can add the WHERE command to your SQL statement:

SELECT nTitle, date_format(nDate, '%d %M, %Y'), nContent FROM news, news_category WHERE category = 1 order by nDate DESC

When doing the match you can use the index of the selected category after getting it from a drop down menu of categories in your PHP code.

Hope that helps.

StephNicolaou 32 Posting Whiz in Training

This was a Java related since I was trying to copy my Java code, but it was not exactly a coding problem, it was an IDE problem.

BTW, In NotePad++, you have to select the Java language to format it in the was the particular language formats it.

StephNicolaou 32 Posting Whiz in Training

I've figured it.

The German NotePad++ CAN actually copy all code with colours/ syntax highlighted...The mouse position must be clicked at the bottom of the page!!

It was only copying up to line 47 because that where my mouse pointed was positioned.

Hope this will hope someone else with this problem.

StephNicolaou 32 Posting Whiz in Training

I have solved this using an alternative method!

I downloaded NotePad++, that allows you to right-click your code inserted, and has the options:

Plugin commands --> Copy text with Syntax Highlighting

I then paste it into word and it retains the colours, where I can easily set the page numbers in Word.

The only thing is that NotePadd++ only copes to copy the colours up to 47 lines!!!
I'd have to keep copy and pasting until I'd copy all 8000 lines!! So, I've got through stage one of figuring this out atleast...

StephNicolaou 32 Posting Whiz in Training

Hi all,

This is also similar to web browsers which use the codes, &d for date, and &l&f&r for document name, etc.

I would like to start the page number for 165, for example, is there a code to do this? (For within the print preview/page setup area).

I've already tried &p+164 and PAGE=165...

Hope you can help,

Steph

Codes

&w Window title
&u Page address (URL)
&d Date in short format (as specified by Regional Settings in Control Panel)
&D Date in long format (as specified by Regional Settings in Control Panel)
&t Time in the format specified by Regional Settings in Control Panel
&T Time in 24-hour format
&p Current page number
&P Total number of pages
&& A single ampersand (&)
&b The text immediately following these characters as centered.
&b&b The text immediately following the first "&b" as centered, and the text following the second "&b" as right-justified.

StephNicolaou 32 Posting Whiz in Training

To construct I normally would use:

L = new Library();

I've also seen others use the newInstance() method.

StephNicolaou 32 Posting Whiz in Training

Have you tried:

CREATE TABLE % (tableName)

?

StephNicolaou 32 Posting Whiz in Training

Have you tried the SELECT DISTINCT and possibly WHERE NOT EXISTS clauses?

StephNicolaou 32 Posting Whiz in Training

Could you please show us the error?

StephNicolaou 32 Posting Whiz in Training

I don't understand, you tried it with 1003 in the apostrophies? Try without the apostrophies because that usually means it is a string.
Otherwise if you want SMITH, LEILA to appear first, I would try:

SELECT lastname, firstname, address, city, state, zip, referenceno FROM tblcustomer WHERE referenceno = 1003 ORDER BY lastname

What is the result you currently get?

StephNicolaou 32 Posting Whiz in Training

You can set the location of the Jframe under the mouse listeners so it will not move from that position

StephNicolaou 32 Posting Whiz in Training

Have you tried:

"SELECT * FROM tblcustomer WHERE referenceno = 1003 ORDER BY lastname"

?

StephNicolaou 32 Posting Whiz in Training

Here are some very good examples of how to link C client programs to MySql and create and populate databases, as well as fetch data:

Really good book:

http://www.kitebird.com/mysql-book/ch06-3ed.pdf

Really good site examples:

http://zetcode.com/tutorials/mysqlcapitutorial/
http://www.cyberciti.biz/tips/linux-unix-connect-mysql-c-api-program.html

The main methods used are:

mysql_config

mysql_real_connect
mysql_query
mysql_use_result
mysql_fetch_row

I hope that helps, the information provided is really clear and easily to understand so take a look :)

StephNicolaou 32 Posting Whiz in Training

No problem! you can mark this thread as solved if that did the trick :)

StephNicolaou 32 Posting Whiz in Training

Which part doesnt work, the frame removing or the game re-starting? If the frame does not close, then you could try the below methods, have a look at the JFrame class, (below).

f.dispose();
f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);

Or the update() method to call paint instead.

http://docs.oracle.com/javase/1.4.2/docs/api/javax/swing/JFrame.html

Then once that works, you can focus on the game restarting. I'm not sure but you need to reload the game class or reconstruct it??

StephNicolaou 32 Posting Whiz in Training

Try:

foreign key (ssn) references Student(ssn),
foreign key (courseId) references Course(courseId)
StephNicolaou 32 Posting Whiz in Training

Even though you're using PHP, you still you HTML to link a page, just use the <a> tag once you've uploaded the page to your server...You should have access to the file manager or FTP details. Look into researching PHP on the links provided or buy a beginners book, details below.

<a href="url" >Page link title on second page</a> tag.

Tutorials:
http://www.w3schools.com/php/default.asp
http://w3schools.com/html/html_links.asp
www.php.net

Book:
www.amazon.com/PHP-BEGINNERS-GUIDE.../dp/0071549013

StephNicolaou 32 Posting Whiz in Training

Try setting the location of your frame under your listeners, so it will always stay in this position

StephNicolaou 32 Posting Whiz in Training

When all numbers are entered at once as a string, a possible solution is to use the following functions:

1. The Len(theString) Function
2. The Left(theString, 1) Function
3. The Cint(theString) Function

1. Gets the length count of the string
2. Gets the character, for each counted one, from left to right
3. Converts the string to an integer

Then I would use a sorting algorthim that you will have to research into yourself. These include Bubble Sort, Counting Sort, Insertion sort, etc. Placing them into a new order in an array...You could then put them into a string variable if you like.

StephNicolaou 32 Posting Whiz in Training

I prefer using an IDE so I don't have to keep checking for the classpath, path and changing the directory to compile the java files I need. The IDE will have these details always stored and know which files I'm compiling without having to specify directories.

IDE's are a lot more flexible with the error messages also, as, on double-click, can direct you to the faulty line of code.

StephNicolaou 32 Posting Whiz in Training

You could post your code in case an OSGI expert comes along but there doesn't seem to be many, I don't really have the OSGI experience myself. IBM seem very knowledgable in this area, I would have a look at their libraries which contain a lot on OSGI (below), there is also an IBM'er on YouTube providing tutorials and also look into OSGI books like O'Reilly.

If none of that work, I would look into checking form more tutorials using something other than NetBeans...

The OSGI Alliance provides tutorials for OSGI with Eclipse Equinox, Knopflerfish and Apache Felix also:

OSGI Alliance - How To
http://www.osgi.org/About/HowOSGi


IBM OSGI Library:

http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.osgifep.multiplatform.doc%2Ftopics%2Fca_mig_ejb.html

YouTube:
www.youtube.com/watch?v=J2wqOY603-Q

OSGI Alliance Books:

Including OSGi Enteprise Specification, v4.2:
http://www.osgi.org/Links/Books

OSGi in Action (I'm helping write this)
http://manning.com/hall/

OSGi in Practice (Creative Commons)
http://neilbartlett.name/blog/osgibook/

Modular Java (OSGi + Spring DM)
http://www.pragprog.com/titles/cwosg/modular-java

Pro Spring Dynamic Modules for OSGiâ„¢ Service Platforms
http://www.apress.com/book/view/1430216123

Hope that helps.

StephNicolaou 32 Posting Whiz in Training

Hm, I don't use NetBeans so I can only advise that you make sure the primary keys in the table are set to auto-increment.

Also, if the New key worked when the primary key columns were visible on the form, just make them invisible, keeping them on the form. Otherwise, you have to link this New key button to the primary through the SQL code behind the New key button.

To bind the key to the table, it should have properties where you can link it to the table and database name, similar to Microsoft Access, which is the only this I can refer from with not having NetBeans in front of me.

Personally, I would code the connection to the database and table with the SQL code behind the new key but look around for the properties. Also try creating the form if NetBeans automatically generates these binds according to your input.

StephNicolaou 32 Posting Whiz in Training

Oh okay, from what I found you can follow this tutorial creating a managed bean into the EAR file then implementing a java interface within the OSGI bundle:

http://netbeans.org/kb/docs/javaee/maven-osgiservice-cdi.html

StephNicolaou 32 Posting Whiz in Training

I would presonally advise you use a course number as a primary key.

Otherwise you will have to use string algorthims to remove the spaces as a delimiter, reduce all characters to lower case, etc.

StephNicolaou 32 Posting Whiz in Training

Well I just rememebered you're actually not using one as password="". Will need more expert advice on this one!

StephNicolaou 32 Posting Whiz in Training

How did you solve it? First thing to do is check that your password is correct since the error message starts with 'access denied'

StephNicolaou 32 Posting Whiz in Training

Yes there are many ways (such as XFBML, Iframe, HTML, etc.) and tutorials online to at least get you started! Look at the youtube guide or web resources provided and then post any errors received:

www.youtube.com/watch?v=KzzqJrrdL5o
http://www.devshed.com/c/a/PHP/Facebook-PHP-API-Applications-Basic-Introduction/1/
http://www.squidoo.com/facebook-like-button-php
http://developers.facebook.com/docs/reference/plugins/like/
http://utterlyboring.com/archives/2010/04/27/facebook_like_b.php

StephNicolaou 32 Posting Whiz in Training

I don't use NetBeans sorry! But here is a NetBeans wiki on how to connect to databases. I wouldn't have through the jar location would have been impotant if you have the path correct.

http://netbeans.org/kb/docs/ide/java-db.html#connecting

StephNicolaou 32 Posting Whiz in Training

Yes, I see that you've answered your own question whilst looking into this. This thread can now be closed!

StephNicolaou 32 Posting Whiz in Training

Try line 42 without the,

.newInstance();

Hope that helps!
Cleo

StephNicolaou 32 Posting Whiz in Training

Have you cleared your cache? If you have removed the .php file from your file manager/server then it should stop displaying once you've deleted temporary files.

If you haven't removed it from your file manager it may also show up if you haven't updated your internal web links. Also DNS may be taking it's time to update.

StephNicolaou 32 Posting Whiz in Training

On line 10, it should be input type="text".

and you can also echo at the same time.

echo $check["defect_code"] . " " . $check["totalDaily"]
StephNicolaou 32 Posting Whiz in Training

Look into the java.util.zip import.

You can then use the GZIPInputStream/GZIPOutputStream with your stream:

InputStream in = new GZIPInputStream(new FileInputStream(file));

I've also seen the TarInputStream being used before. There are a few tutorials out there:

The class file:
http://www.jajakarta.org/ant/ant-1.6.1/docs/en/manual/api/org/apache/tools/tar/TarInputStream.html

Oracle:
http://java.sun.com/developer/technicalArticles/Programming/compression/

Dev Daily:
http://www.devdaily.com/java/jwarehouse/javatar-2.5/source/com/ice/tar/TarInputStream.java.shtml

Good luck!

StephNicolaou 32 Posting Whiz in Training

If you are currently echoing every age option under 100, do you want the selected age?

Have you tried the get method?

$_Get Variable on w3s:

http://www.w3schools.com/php/php_get.asp

Session Variables:

http://www.w3schools.com/php/php_sessions.asp

echo $_GET['age']; or
$var = intval($_get['age']);
StephNicolaou 32 Posting Whiz in Training

You have to change the encoding and use a stream reader. Look up internalisation and how to convert non-UTF back to UTF:

Oracle tutorials:

http://docs.oracle.com/javase/tutorial/i18n/index.html
http://docs.oracle.com/javase/tutorial/i18n/text/convertintro.html

StephNicolaou 32 Posting Whiz in Training

Would you like the total of the 5 total sales? You will need to add these up before you convert to string including a result variable.

total = total + intStore

Post your error, what to you want to fix/improve here?

StephNicolaou 32 Posting Whiz in Training

This code doesn't even include the select statement, debasisdas has already solved this really...Post the code with this select statement included.

StephNicolaou 32 Posting Whiz in Training

On line 3 try:

Dim new_node As TreeNode 
new_node = parent_nodes.Add(child_node.Name)
StephNicolaou 32 Posting Whiz in Training

PHP.Net is also good. They have a manual including a Getting Started guide...

http://uk.php.net/manual/en/
http://uk.php.net/manual/en/getting-started.php

StephNicolaou 32 Posting Whiz in Training

Post the specific PHP erroneous code section and the error to be able to work from what you've got?

StephNicolaou 32 Posting Whiz in Training

Post your erroneous code section to be able to work from what you've got?

StephNicolaou 32 Posting Whiz in Training

Post the error.. Have you tried making a public function, returning then echoing the value you want?

echo $name -> functionName(); 
or
protected _values = whatever;
echo $name -> _values;
StephNicolaou 32 Posting Whiz in Training

Make sure you are using the correct version of the sql connector, Connector/J 5.1.18 is the latest:

http://www.mysql.com/downloads/connector/j/

Check whether you connection is correct, your path, username and password are correct.

Instructions are provided below:

http://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/

I don't use Netbeans, I would package it in command line so see if that helps.

http://docs.oracle.com/javase/tutorial/deployment/jar/build.html
http://www.skylit.com/javamethods/faqs/createjar.html

StephNicolaou 32 Posting Whiz in Training

If you are on a tight deadline, I would say to just carry on and worry about this after you've finished as your teacher has advised. You're not scored on this so you will limit the score you can achieve by delaying on this. If the components are huge on the laptop this just means she is using a very low resolution.

When using many components, a layout may have helped.

http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html

*You could change your layout based on a low resolution so you won't receive any problems from the higher resolution users.* Just slightly smaller components still in the right position and not off the form.

Another suggestion is to get the user's resolution using the getScreenSize method, and change the null layout based on the resolution - but a lot of time and extra un-needed code:

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

http://www.sightspecific.com/~mosh/Tricks/ScreenRes/

I wouldn't really advise this though. I would reduce your own resolution and modify the component positions based on that.

StephNicolaou 32 Posting Whiz in Training

If you have started this, then keep going at it and post any code with the error you are struggling with (in code tags). Don't panic about the project, work at it and you'll get into it.

StephNicolaou 32 Posting Whiz in Training

Peter,

<!-- This is a comment -->

The DTD problem is with your track+ element where you have not stated it's additional track elements, e.g.

<!ELEMENT track (element1, element2, element3) >

If you do not need any 'child' elements for the 'parent' track element, then remove the +.

See DTD examples which use the + on the w3schools website:

http://www.w3schools.com/dtd/dtd_examples.asp

It also holds a lot of useful XML information such as Syntax Rules which include how to comment, etc.

http://www.w3schools.com/xml/xml_syntax.asp