Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 4.50 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-15-2008, 12:34 AM   PM User | #1
dealmaker
Regular Coder

 
Join Date: Jul 2005
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
dealmaker has a little shameless behaviour in the past
Question http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd Made My Code All Wecky. Why?

Hi,
In the original code, there is "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" in the second line in the html code, it works fine until I added a bunch of <div> inside <td> with css. I spent the whole day debugging the problem and I found that it works fine if I replaced it with "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">". Why? Does it do me any harm if I do that?

Thank you.

Last edited by dealmaker; 05-15-2008 at 12:57 AM..
dealmaker is offline   Reply With Quote
Old 05-15-2008, 12:42 AM   PM User | #2
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by dealmaker View Post
Hi,
In the original code, there is "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" >" in the second line in the html code, it works fine until I added a bunch of <div> inside <td> with css. I spent the whole day debugging the problem and I found that it works fine if I remove this xmlns in html tag. Why? Does it do me any harm if I remove xmlns?

Thank you.
without looking to the page is hard to know what's happend but I guess that with default namespace aka xmlns your code is less invalid then without, . Try to validate and if you have problems after that post the link.

regards
oesxyl is offline   Reply With Quote
Old 05-15-2008, 12:55 AM   PM User | #3
dealmaker
Regular Coder

 
Join Date: Jul 2005
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
dealmaker has a little shameless behaviour in the past
Question

Thanks. Actually I just found that it was due to the doctype, not xmlns. I just corrected my post. Please reread my post, and please let me know what you think.

Quote:
Originally Posted by oesxyl View Post
without looking to the page is hard to know what's happend but I guess that with default namespace aka xmlns your code is less invalid then without, . Try to validate and if you have problems after that post the link.

regards
dealmaker is offline   Reply With Quote
Old 05-15-2008, 01:16 AM   PM User | #4
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by dealmaker View Post
Hi,
In the original code, there is "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" in the second line in the html code, it works fine until I added a bunch of <div> inside <td> with css. I spent the whole day debugging the problem and I found that it works fine if I replaced it with "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">". Why? Does it do me any harm if I do that?

Thank you.
no, is no problem what doctype you use since the code is valid for that doctype, probably the html code is valid for html 4.01. I suggest to validate, use w3c validator and if is valid and look how you want, I think that you don't have any reason to warry.
If you have errors, fix them and if after that don't look how you want, post link and I help you if I know how,

PS: It could be better to validate css
regards

Last edited by oesxyl; 05-15-2008 at 01:20 AM..
oesxyl is offline   Reply With Quote
Old 05-15-2008, 01:48 AM   PM User | #5
dealmaker
Regular Coder

 
Join Date: Jul 2005
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
dealmaker has a little shameless behaviour in the past
Question

The following is the code, try to switch between 2 doctype tag then you will see what I am saying. I still can't figure out why...

Code:
<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" >
<HEAD>
<TITLE>Page 100</TITLE>

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<STYLE type="text/css">
<!--
	.ft0{font-size:4px;font-family:Times;color:#272526;}
	.ft1{font-size:8px;font-family:Times;color:#272526;}
	.ft2{font-size:9px;font-family:Times;color:#272526;}
	.ft3{font-size:6px;font-family:Times;color:#272526;}
	.ft4{font-size:6px;font-family:Times;color:#fefefe;}
	.ft5{font-size:7px;font-family:Times;color:#272526;}
	.ft6{font-size:8px;line-height:13px;font-family:Times;color:#272526;}
-->
</STYLE>
</HEAD>

<BODY bgcolor="#A0A0A0" vlink="blue" link="blue">
<div style="position:relative;width:531;height:666;">
<IMG width="531" height="666" src="a100.png" alt="background image">
<div style="position:absolute;top:59;left:110"><nobr><span class="ft0">■■</span></nobr></div>
<div style="position:absolute;top:58;left:125;"><nobr><span class="ft6">ResultSetHoldability—This parameter is not implemented in Connector/J’s<br>implementation of createStatement().</span></nobr></div>
<DIV style="position:absolute;top:91;left:109"><nobr><span class="ft6">When you’re using the createStatement() methods, you include the parameters<br>when you’re creating a ResultSet or use the defaults as appropriate. In most<br>cases, you use createStatement() without any parameters.</span></nobr></DIV>
<DIV style="position:absolute;top:146;left:110"><nobr><span class="ft2"><i>Executing SQL</i></span></nobr></DIV>
<DIV style="position:absolute;top:167;left:110"><nobr><span class="ft6">Now that we have a Statement object, it’s time to execute the SQL statements<br>designed to return results for use in our application. The Statement object<br>includes several types of query methods, as shown in Appendix B. In this sec-<br>tion, we cover the method executeQuery(), which is designed to execute SQL<br>that will return a result. This means the method expects to execute a SELECT<br>query. </span></nobr></DIV>
<DIV style="position:absolute;top:252;left:110"><nobr><span class="ft6">In our example code, the following line sets off the process of retrieving results<br>from the database:</span></nobr></DIV>
<DIV style="position:absolute;top:285;left:121"><nobr><span class="ft3">ResultSet rs = statement.executeQuery(&quot;SELECT * FROM acc_acc&quot;);</span></nobr></DIV>
<DIV style="position:absolute;top:302;left:110"><nobr><span class="ft6">There are a few things you should note about this code. The first is that the SQL<br>query statement is provided to the executeQuery() method as a String. The<br>object passes the query to the database, which in turn executes it. Connector/J<br>doesn’t, and shouldn’t, make any type of determination on the validity of the<br>SQL being passed by the application. If the database is unable to execute the<br>SQL, a SQLException exception will be thrown. If the command is successful,<br>the executeQuery() method returns a ResultSet object containing the rows<br>from the database. </span></nobr></DIV>
<DIV style="position:absolute;top:412;left:110"><nobr><span class="ft6">Ultimately, three outcomes can occur when the executeQuery() method exe-<br>cutes. The first is an exception. An exception can occur for many reasons,<br>among them are the following:</span></nobr></DIV>
<DIV style="position:absolute;top:456;left:110"><nobr><span class="ft0">■■</span></nobr></DIV>
<DIV style="position:absolute;top:455;left:125"><nobr><span class="ft1">The connection is no longer valid to the database server.</span></nobr></DIV>
<DIV style="position:absolute;top:473;left:110"><nobr><span class="ft0">■■</span></nobr></DIV>
<DIV style="position:absolute;top:472;left:125"><nobr><span class="ft1">The SQL has a syntax error in it.</span></nobr></DIV>
<DIV style="position:absolute;top:490;left:110"><nobr><span class="ft0">■■</span></nobr></DIV>
<DIV style="position:absolute;top:489;left:125"><nobr><span class="ft6">The currently logged-in user doesn’t have permission to the database table<br>used in the SQL.</span></nobr></DIV>
<DIV style="position:absolute;top:522;left:109"><nobr><span class="ft6">You need to wrap your executeQuery() in a try/catch block, but it will be a<br>design issue as to which errors you attempt to recover from and which allow<br>the application to fail. There are some database operation errors that you<br>recover from by changing the nature of the operation—you might be able to<br>connect to a secondary database, or limit the results. Other errors may be cata-<br>strophic, like being unable to update the database. The second outcome is a<br>ResultSet with results in it. This is the most favorable outcome. The third </span></nobr></DIV>
<DIV style="position:absolute;top:29;left:371"><nobr><span class="ft4"><b>Hello World</b></span></nobr></DIV>
<DIV style="position:absolute;top:28;left:449"><nobr><span class="ft5"><b>77</b></span></nobr></DIV>
</DIV>
</BODY>
</HTML>
Quote:
Originally Posted by oesxyl View Post
no, is no problem what doctype you use since the code is valid for that doctype, probably the html code is valid for html 4.01. I suggest to validate, use w3c validator and if is valid and look how you want, I think that you don't have any reason to warry.
If you have errors, fix them and if after that don't look how you want, post link and I help you if I know how,

PS: It could be better to validate css
regards
dealmaker is offline   Reply With Quote
Old 05-15-2008, 02:06 AM   PM User | #6
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
validate! you have 140 error with xhtml and 20 with html 4.01.

http://validator.w3.org/

how do you expect to work?

regards
oesxyl is offline   Reply With Quote
Old 05-15-2008, 02:18 AM   PM User | #7
dealmaker
Regular Coder

 
Join Date: Jul 2005
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
dealmaker has a little shameless behaviour in the past
I looked at the errors, and I found that all of the so called errors are not supposed to affect anything. e.g. it wants all tags to be lowercase, <br> without closing tag, etc. They are all acceptable for all browsers.

Quote:
Originally Posted by oesxyl View Post
validate! you have 140 error with xhtml and 20 with html 4.01.

http://validator.w3.org/

how do you expect to work?

regards
dealmaker is offline   Reply With Quote
Old 05-15-2008, 02:31 AM   PM User | #8
FWDrew
Regular Coder

 
FWDrew's Avatar
 
Join Date: Apr 2008
Location: Missouri
Posts: 380
Thanks: 38
Thanked 45 Times in 43 Posts
FWDrew is on a distinguished road
Quote:
<br> without closing tag
All tags should be closed to avoid errors.

Self close the br tags like this:
Code:
<br />
note the space after the "br"

Drew
FWDrew is offline   Reply With Quote
Old 05-15-2008, 02:52 AM   PM User | #9
dealmaker
Regular Coder

 
Join Date: Jul 2005
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
dealmaker has a little shameless behaviour in the past
Question

That's not the reason why you see the format goes all weird.

Quote:
Originally Posted by FWDrew View Post
All tags should be closed to avoid errors.

Self close the br tags like this:
Code:
<br />
note the space after the "br"

Drew
dealmaker is offline   Reply With Quote
Old 05-15-2008, 02:58 AM   PM User | #10
FWDrew
Regular Coder

 
FWDrew's Avatar
 
Join Date: Apr 2008
Location: Missouri
Posts: 380
Thanks: 38
Thanked 45 Times in 43 Posts
FWDrew is on a distinguished road
Quote:
Originally Posted by dealmaker View Post
That's not the reason why you see the format goes all weird.
No, that probably has to do with the 100+ errors you have with your coding.

That, however, is a proper way to close a br tag, since you didnt seem to know looking at your code.

Drew
FWDrew is offline   Reply With Quote
Old 05-15-2008, 03:03 AM   PM User | #11
radamsiii
New Coder

 
Join Date: May 2008
Posts: 56
Thanks: 9
Thanked 1 Time in 1 Post
radamsiii is an unknown quantity at this point
This will get you to 17 errors. Someone can probably tell you how to get rid of the nobr’s with no-wrap and you will be 100%
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Page 100</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">

	.ft0{font-size:4px;font-family:Times;color:#272526;}
	.ft1{font-size:8px;font-family:Times;color:#272526;}
	.ft2{font-size:9px;font-family:Times;color:#272526;}
	.ft3{font-size:6px;font-family:Times;color:#272526;}
	.ft4{font-size:6px;font-family:Times;color:#fefefe;}
	.ft5{font-size:7px;font-family:Times;color:#272526;}
	.ft6{font-size:8px;line-height:13px;font-family:Times;color:#272526;}
</style>
</head>

<body bgcolor="#A0A0A0" vlink="blue" link="blue">
<div style="position:relative;width:531;height:666;">

<img width="531" height="666" src="a100.png" alt="background image" />
<div style="position:absolute;top:59;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:58;left:125;"><nobr><span class="ft6">ResultSetHoldability—This parameter is not implemented in Connector/J’s
<br />implementation of createStatement().
</span></nobr></div>
<div style="position:absolute;top:91;left:109"><nobr><span class="ft6">When you’re using the createStatement() methods, you include the parameters
<br />when you’re creating a ResultSet or use the defaults as appropriate. In most
<br />cases, you use createStatement() without any parameters.
</span></nobr></div>
<div style="position:absolute;top:146;left:110"><nobr><span class="ft2"><i>Executing SQL</i>
</span></nobr></div>
<div style="position:absolute;top:167;left:110"><nobr><span class="ft6">Now that we have a Statement object, it’s time to execute the SQL statements
<br />designed to return results for use in our application. The Statement object
<br />includes several types of query methods, as shown in Appendix B. In this sec-
<br />tion, we cover the method executeQuery(), which is designed to execute SQL
<br />that will return a result. This means the method expects to execute a SELECT
<br />query. 
</span></nobr></div>
<div style="position:absolute;top:252;left:110"><nobr><span class="ft6">In our example code, the following line sets off the process of retrieving results
<br />from the database:
</span></nobr></div>
<div style="position:absolute;top:285;left:121"><nobr><span class="ft3">ResultSet rs = statement.executeQuery(&quot;SELECT * FROM acc_acc&quot;);
</span></nobr></div>
<div style="position:absolute;top:302;left:110"><nobr><span class="ft6">There are a few things you should note about this code. The first is that the SQL
<br />query statement is provided to the executeQuery() method as a String. The
<br />object passes the query to the database, which in turn executes it. Connector/J
<br />doesn’t, and shouldn’t, make any type of determination on the validity of the
<br />SQL being passed by the application. If the database is unable to execute the
<br />SQL, a SQLException exception will be thrown. If the command is successful,
<br />the executeQuery() method returns a ResultSet object containing the rows
<br />from the database. 
</span></nobr></div>
<div style="position:absolute;top:412;left:110"><nobr><span class="ft6">Ultimately, three outcomes can occur when the executeQuery() method exe-
<br />cutes. The first is an exception. An exception can occur for many reasons,
<br />among them are the following:
</span></nobr></div>
<div style="position:absolute;top:456;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:473;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:472;left:125"><nobr><span class="ft1">The SQL has a syntax error in it.
</span></nobr></div>
<div style="position:absolute;top:490;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:489;left:125"><nobr><span class="ft6">The currently logged-in user doesn’t have permission to the database table
<br />used in the SQL.
</span></nobr></div>
<div style="position:absolute;top:522;left:109"><nobr><span class="ft6">You need to wrap your executeQuery() in a try/catch block, but it will be a
<br />design issue as to which errors you attempt to recover from and which allow
<br />the application to fail. There are some database operation errors that you
<br />recover from by changing the nature of the operation—you might be able to
<br />connect to a secondary database, or limit the results. Other errors may be cata-
<br />strophic, like being unable to update the database. The second outcome is a
<br />ResultSet with results in it. This is the most favorable outcome. The third 
</span></nobr></div>
<div style="position:absolute;top:29;left:371"><nobr><span class="ft4"><b>Hello World</b>
</span></nobr></div>
<div style="position:absolute;top:28;left:449"><nobr><span class="ft5"><b>77</b>
</span></nobr></div>
</div>
</body>
</html>
how it is ok to play with your code.
__________________
Dedicate some time to Educate your mind
radamsiii is offline   Reply With Quote
Old 05-15-2008, 04:41 AM   PM User | #12
radamsiii
New Coder

 
Join Date: May 2008
Posts: 56
Thanks: 9
Thanked 1 Time in 1 Post
radamsiii is an unknown quantity at this point
This works with 2 errors, I got the information from this site http://www.w3.org/International/tuto...enc/#Slide0150
But when I get about 2/3 through the page it starts getting over my head, maybe someone else can pick up if I am on the right track. sorry

Code:
<?xml version="1.0" encoding="iso-UTF-8"?>   
<head>

<title>Page 100</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-UTF-8" />
 

<style type="text/css">

	.ft0{font-size:4px;font-family:Times;color:#272526;}
	.ft1{font-size:8px;font-family:Times;color:#272526;}
	.ft2{font-size:9px;font-family:Times;color:#272526;}
	.ft3{font-size:6px;font-family:Times;color:#272526;}
	.ft4{font-size:6px;font-family:Times;color:#fefefe;}
	.ft5{font-size:7px;font-family:Times;color:#272526;}
	.ft6{font-size:8px;line-height:13px;font-family:Times;color:#272526;}
</style>
</head>

<body bgcolor="#A0A0A0" vlink="blue" link="blue">
<div style="position:relative;width:531;height:666;">

<img width="531" height="666" src="a100.png" alt="background image" />
<div style="position:absolute;top:59;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:58;left:125;"><nobr><span class="ft6">ResultSetHoldability—This parameter is not implemented in Connector/J’s
<br />implementation of createStatement().
</span></nobr></div>
<div style="position:absolute;top:91;left:109"><nobr><span class="ft6">When you’re using the createStatement() methods, you include the parameters
<br />when you’re creating a ResultSet or use the defaults as appropriate. In most
<br />cases, you use createStatement() without any parameters.
</span></nobr></div>
<div style="position:absolute;top:146;left:110"><nobr><span class="ft2"><i>Executing SQL</i>
</span></nobr></div>
<div style="position:absolute;top:167;left:110"><nobr><span class="ft6">Now that we have a Statement object, it’s time to execute the SQL statements
<br />designed to return results for use in our application. The Statement object
<br />includes several types of query methods, as shown in Appendix B. In this sec-
<br />tion, we cover the method executeQuery(), which is designed to execute SQL
<br />that will return a result. This means the method expects to execute a SELECT
<br />query. 
</span></nobr></div>
<div style="position:absolute;top:252;left:110"><nobr><span class="ft6">In our example code, the following line sets off the process of retrieving results
<br />from the database:
</span></nobr></div>
<div style="position:absolute;top:285;left:121"><nobr><span class="ft3">ResultSet rs = statement.executeQuery(&quot;SELECT * FROM acc_acc&quot;);
</span></nobr></div>
<div style="position:absolute;top:302;left:110"><nobr><span class="ft6">There are a few things you should note about this code. The first is that the SQL
<br />query statement is provided to the executeQuery() method as a String. The
<br />object passes the query to the database, which in turn executes it. Connector/J
<br />doesn’t, and shouldn’t, make any type of determination on the validity of the
<br />SQL being passed by the application. If the database is unable to execute the
<br />SQL, a SQLException exception will be thrown. If the command is successful,
<br />the executeQuery() method returns a ResultSet object containing the rows
<br />from the database. 
</span></nobr></div>
<div style="position:absolute;top:412;left:110"><nobr><span class="ft6">Ultimately, three outcomes can occur when the executeQuery() method exe-
<br />cutes. The first is an exception. An exception can occur for many reasons,
<br />among them are the following:
</span></nobr></div>
<div style="position:absolute;top:456;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:473;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:472;left:125"><nobr><span class="ft1">The SQL has a syntax error in it.
</span></nobr></div>
<div style="position:absolute;top:490;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:489;left:125"><nobr><span class="ft6">The currently logged-in user doesn’t have permission to the database table
<br />used in the SQL.
</span></nobr></div>
<div style="position:absolute;top:522;left:109"><nobr><span class="ft6">You need to wrap your executeQuery() in a try/catch block, but it will be a
<br />design issue as to which errors you attempt to recover from and which allow
<br />the application to fail. There are some database operation errors that you
<br />recover from by changing the nature of the operation—you might be able to
<br />connect to a secondary database, or limit the results. Other errors may be cata-
<br />strophic, like being unable to update the database. The second outcome is a
<br />ResultSet with results in it. This is the most favorable outcome. The third 
</span></nobr></div>
<div style="position:absolute;top:29;left:371"><nobr><span class="ft4"><b>Hello World</b>
</span></nobr></div>
<div style="position:absolute;top:28;left:449"><nobr><span class="ft5"><b>77</b>
</span></nobr></div>
</div>
</body>
</html>
__________________
Dedicate some time to Educate your mind
radamsiii is offline   Reply With Quote
Old 05-15-2008, 04:49 AM   PM User | #13
dealmaker
Regular Coder

 
Join Date: Jul 2005
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
dealmaker has a little shameless behaviour in the past
But this has to work with either the doctype xhtml or html tag because I need that for other purpose. Otherwise, I would just remove doctype tag and the code will work without any correction.

Quote:
Originally Posted by radamsiii View Post
This works with 2 errors, I got the information from this site http://www.w3.org/International/tuto...enc/#Slide0150
But when I get about 2/3 through the page it starts getting over my head, maybe someone else can pick up if I am on the right track. sorry

Code:
<?xml version="1.0" encoding="iso-UTF-8"?>   
<head>

<title>Page 100</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-UTF-8" />
 

<style type="text/css">

	.ft0{font-size:4px;font-family:Times;color:#272526;}
	.ft1{font-size:8px;font-family:Times;color:#272526;}
	.ft2{font-size:9px;font-family:Times;color:#272526;}
	.ft3{font-size:6px;font-family:Times;color:#272526;}
	.ft4{font-size:6px;font-family:Times;color:#fefefe;}
	.ft5{font-size:7px;font-family:Times;color:#272526;}
	.ft6{font-size:8px;line-height:13px;font-family:Times;color:#272526;}
</style>
</head>

<body bgcolor="#A0A0A0" vlink="blue" link="blue">
<div style="position:relative;width:531;height:666;">

<img width="531" height="666" src="a100.png" alt="background image" />
<div style="position:absolute;top:59;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:58;left:125;"><nobr><span class="ft6">ResultSetHoldability—This parameter is not implemented in Connector/J’s
<br />implementation of createStatement().
</span></nobr></div>
<div style="position:absolute;top:91;left:109"><nobr><span class="ft6">When you’re using the createStatement() methods, you include the parameters
<br />when you’re creating a ResultSet or use the defaults as appropriate. In most
<br />cases, you use createStatement() without any parameters.
</span></nobr></div>
<div style="position:absolute;top:146;left:110"><nobr><span class="ft2"><i>Executing SQL</i>
</span></nobr></div>
<div style="position:absolute;top:167;left:110"><nobr><span class="ft6">Now that we have a Statement object, it’s time to execute the SQL statements
<br />designed to return results for use in our application. The Statement object
<br />includes several types of query methods, as shown in Appendix B. In this sec-
<br />tion, we cover the method executeQuery(), which is designed to execute SQL
<br />that will return a result. This means the method expects to execute a SELECT
<br />query. 
</span></nobr></div>
<div style="position:absolute;top:252;left:110"><nobr><span class="ft6">In our example code, the following line sets off the process of retrieving results
<br />from the database:
</span></nobr></div>
<div style="position:absolute;top:285;left:121"><nobr><span class="ft3">ResultSet rs = statement.executeQuery(&quot;SELECT * FROM acc_acc&quot;);
</span></nobr></div>
<div style="position:absolute;top:302;left:110"><nobr><span class="ft6">There are a few things you should note about this code. The first is that the SQL
<br />query statement is provided to the executeQuery() method as a String. The
<br />object passes the query to the database, which in turn executes it. Connector/J
<br />doesn’t, and shouldn’t, make any type of determination on the validity of the
<br />SQL being passed by the application. If the database is unable to execute the
<br />SQL, a SQLException exception will be thrown. If the command is successful,
<br />the executeQuery() method returns a ResultSet object containing the rows
<br />from the database. 
</span></nobr></div>
<div style="position:absolute;top:412;left:110"><nobr><span class="ft6">Ultimately, three outcomes can occur when the executeQuery() method exe-
<br />cutes. The first is an exception. An exception can occur for many reasons,
<br />among them are the following:
</span></nobr></div>
<div style="position:absolute;top:456;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:473;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:472;left:125"><nobr><span class="ft1">The SQL has a syntax error in it.
</span></nobr></div>
<div style="position:absolute;top:490;left:110"><nobr><span class="ft0">■■
</span></nobr></div>
<div style="position:absolute;top:489;left:125"><nobr><span class="ft6">The currently logged-in user doesn’t have permission to the database table
<br />used in the SQL.
</span></nobr></div>
<div style="position:absolute;top:522;left:109"><nobr><span class="ft6">You need to wrap your executeQuery() in a try/catch block, but it will be a
<br />design issue as to which errors you attempt to recover from and which allow
<br />the application to fail. There are some database operation errors that you
<br />recover from by changing the nature of the operation—you might be able to
<br />connect to a secondary database, or limit the results. Other errors may be cata-
<br />strophic, like being unable to update the database. The second outcome is a
<br />ResultSet with results in it. This is the most favorable outcome. The third 
</span></nobr></div>
<div style="position:absolute;top:29;left:371"><nobr><span class="ft4"><b>Hello World</b>
</span></nobr></div>
<div style="position:absolute;top:28;left:449"><nobr><span class="ft5"><b>77</b>
</span></nobr></div>
</div>
</body>
</html>
dealmaker is offline   Reply With Quote
Old 05-15-2008, 05:16 AM   PM User | #14
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
You NEED the doctype. It tells the browser how to render the page. The first doctype you used was partial. The next one you used was the incorrect one because it was pretty clear you weren't using XHTML. You were using HTML. Both the partial doctype and this line
Code:
<?xml version="1.0" encoding="iso-UTF-8"?>
throw IE6 into quirks mode. Haven't you ever wondered why your code looked okay in Firefox but not IE? Its because of poor coding.

Once you start using a complete doctype you need to use units on everything. You have some top and left values without units which is causing your problems.

Why so much absolute positioning? I think you are abusing it and don't even know you are doing so.

Also if that really is page 100 then you are going about things the wrong way. I suggest looking into some type of server side language or a database as its very inefficient to have that many static pages.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||

Last edited by _Aerospace_Eng_; 05-15-2008 at 05:18 AM..
_Aerospace_Eng_ is offline   Reply With Quote
Old 05-15-2008, 06:48 AM   PM User | #15
dealmaker
Regular Coder

 
Join Date: Jul 2005
Posts: 342
Thanks: 0
Thanked 0 Times in 0 Posts
dealmaker has a little shameless behaviour in the past
wow, thanks. I add px to all of them, and they all work now without any modification!

I am using firefox btw.

Quote:
Originally Posted by _Aerospace_Eng_ View Post
You NEED the doctype. It tells the browser how to render the page. The first doctype you used was partial. The next one you used was the incorrect one because it was pretty clear you weren't using XHTML. You were using HTML. Both the partial doctype and this line
Code:
<?xml version="1.0" encoding="iso-UTF-8"?>
throw IE6 into quirks mode. Haven't you ever wondered why your code looked okay in Firefox but not IE? Its because of poor coding.

Once you start using a complete doctype you need to use units on everything. You have some top and left values without units which is causing your problems.

Why so much absolute positioning? I think you are abusing it and don't even know you are doing so.

Also if that really is page 100 then you are going about things the wrong way. I suggest looking into some type of server side language or a database as its very inefficient to have that many static pages.
dealmaker is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:44 PM.


Advertisement
Log in to turn off these ads.