Sty - COMPUTER ENGINEERING
It's all about Internet, Security, Vulnerability, Programming, Networking, Software, and also Open Source Software. May this weblog can be your source of IT 's articles.

News Link

Loading...

When you want to connect to a SQL Server database, you have to authenticate, so the database know which user is trying to access. Microsoft SQL Server supports two authentication method: SQL Server Authentication and Windows Authentication (often called Integrated Security).

SQL Server Authentication

First, I would explain SQL Server Authentication. SQL Server takes care of user management, means that users and their passwords are managed by SQL Server. You can access the user management functionality in SQL Server through the Enterprise Manager (for SQL Server 2000) or the SQL Server Management Studio (for SQL Server 2005).

To connect to a SQL Server instance that uses SQL Server authentication, you need to pass a user name and password in the connection string of your application, ex:ASP.NET Web Application. Connection string usualy looks like this:

Data Source=;Initial Catalog=;
User Id=UserName;Password=Password;


Windows Authentication

Next, Windows Authentication, the OS (Windows) takes care of user management. All interaction with the database is done in the context of the calling user so the database knows who's accessing the system, without an explicit user name and password being passed in the connection string. You still need to map a Windows account to a SQL Server account so SQL Server can determine whether the account has sufficient permissions.

Connection string using Windows Authentication usualy looks like this:

Data Source=;Initial Catalog=;
Integrated Security=SSPI;


or

Data Source=YourServer;Initial Catalog=YourDatabase;
Trusted_Connection=True;


Windows or SQL Server Authentication?

In general, it's recommended to use Windows authentication. The fact that you don't need to use a password in the connection string, means your application will be a bit safer. You don't need to send the password over the wire, and there's no need to store it in a configuration file for your application where it can be viewed by anyone with access to that file.

However, SQL Server Authentication is a bit easier to use. Since you specify your own user name and password, you don't need to know the final user account that your application runs under.

Sty - Knowledge is Free
Read More..

I try to compiled this guide for Acer 4520 users, some variants of this model may work with this tips, the other may not, hope you the lucky number one . This guide below I write in Indonesian, sorry for disappointing you, because lacks of guide about this issues in Indonesian.

http://sty-thehybrid.blogspot.com/2008/03/installing-ubuntu-710-aka-gutsy-gibbon.html

Sty - Knowledge is Free
Read More..

One term you can't go far into databases without encountering is SQL, which stands for Structured Query Language. SQL is the language used to retrieve, add, modify, and delete records in databases. Let's look at each of these features in turn.

By the Way

Incidentally, the pronunciation of SQL is somewhat of a contentious issue. The official party line is that SQL should be pronounced "es queue el." However, many people opt for the more casual and also more efficient pronunciation, "sequel." Count me in the latter camp!

Retrieving Records Using SELECT
Just about everything in SQL is carried out via a query, which is simply the act of communicating with the database according to an established set of SQL commands. The query used to retrieve data from a database is called the SELECT statement. It has several parts, not all of which are mandatory. The most basic SELECT statement is composed of two partsthe select list and the FROM clause. A very simple SELECT statement looks like this:

SELECT * FROM students

Following are the database records returned as the results of the query:
+-------------+-----------------+--------------------+-------+----------------+---------+
| id_students | student_name | city | state | classification | tuition |
+-------------+-----------------+--------------------+-------+----------------+---------+
| 1 | Franklin Pierce | Hillsborough | NH | senior | 5000 |
| 2 | James Polk | Mecklenburg County | NC | freshman | 11000 |
| 2 | Warren Harding | Marion | OH | junior | 3500 |
+-------------+-----------------+--------------------+-------+----------------+---------+


In this case, the * is the select list. The select list indicates which database columns should be included in the query results. When a * is supplied, it indicates that all of the columns in the table or tables listed in the FROM clause should be included in the query results.

The FROM clause contains the list of tables from which the data will be retrieved. In this case, the data is retrieved from just one table, students. I'll explain how to retrieve data from multiple tables in a bit.

Let's go back to the select list. If you use a select list that isn't simply *, you include a list of column names separated by commas. You can also rename columns in the query results (useful in certain situations), using the AS keyword, as follows:

SELECT id_students AS id, student_name, state
FROM students


As the results show, only the student name and state columns are returned for the records:

+------+-----------------+-------+
| id | student_name | state |
+------+-----------------+-------+
| 1 | Franklin Pierce | NH |
| 2 | James Polk | NC |
| 2 | Warren Harding | OH |
+------+-----------------+-------+



The id_students column is renamed id in the query results using the reserved word 'AS'. The other keyword you'll often use in a select statement is DISTINCT. When you include DISTINCT at the beginning of a select statement, it indicates that no duplicates should be included in the query results. Here's a sample query:

SELECT DISTINCT city
FROM students


And here are the results:

+--------------------+
| city |
+--------------------+
| Hillsborough |
| Mecklenburg County |
| Marion |
+--------------------+



Without DISTINCT, this query would return the city of every student in the students table. In this case, it returns only the distinct values in the table, regardless of how many of each of them there are. In this case, there are only three records in the table and each of them has a unique city, so the result set is the same as it would be if DISTINCT were left off.

The WHERE Clause
Both of the previous queries simply return all of the records in the students table. Often, you'll want to constrain the resultset so that it returns only those records you're actually interested in. The WHERE clause is used to specify which records in a table should be included in the results of a query. Here's an example:

SELECT student_name
FROM students
WHERE id_students = 1


Only the record with the matching ID is returned in the results:

+-----------------+
| student_name |
+-----------------+
| Franklin Pierce |
+-----------------+



When you use the WHERE clause, you must include an expression that filters the query results. In this case, the expression is very simple. Given that id_students is the primary key for this table, this query is sure to return only one row. You can use other comparison operators as well, like the > or != operators. It's also possible to use Boolean operators to create compound expressions. For example, you can retrieve all of the students who pay more than $10,000 per year in tuition and who are classified as freshmen using the following query:

SELECT student_name
FROM students
WHERE tuition > 10000
AND classification = 'freshman'


Following are the results of this query:

+--------------+
| student_name |
+--------------+
| James Polk |
+--------------+



There are also several other functions you can use in the WHERE clause that enable you to write more powerful queries. The LIKE function allows you to search for fields containing a particular string using a regular expression like syntax. The BETWEEN function allows you to search for values between the two you specify, and IN allows you to test whether a value is a member of a set you specify.

By the Way

Because the goal in this hour is ultimately to learn how to use XML with databases, I won't go into any more detail on these query functions, but feel free to do some additional SQL learning online at http://www.w3schools.com/sql/default.asp, or pick up a book on SQL. Fortunately, you don't have to be a SQL guru to get the benefits of this lesson.


Inserting Records
The INSERT statement is used to insert records into a table. The syntax is simple, especially if you plan on populating every column in a table. To insert a record into majors, use the following statement:

INSERT INTO majors
VALUES (115, 50, 'Math', 'English')


The values in the list correspond to the id_majors, id_students, major, and minor columns respectively. If you only want to specify values for a subset of the columns in the table, you must specify the names of the columns as well, as in the following:

INSERT INTO students
(id_students, student_name)
VALUES (50, 'Milton James')


When you create tables, you can specify whether values are required in certain fields, and you can also specify default values for fields. For example, the classification column might default to freshman because most new student records being inserted will be for newly enrolled students, who are classified as freshmen.

Updating Records
When you want to modify one or more records in a table, the UPDATE statement is used. Here's an example:

UPDATE students
SET classification = 'senior'


The previous SQL statement will work, but I bet you can figure out what's wrong with it. Nowhere is it specified which records to update. If you don't tell it which records to update, it just assumes that you want to update all of the records in the table, thus the previous query would turn all of the students into seniors. That's probably not what you have in mind. Fortunately, the UPDATE statement supports the WHERE clause, just like the SELECT statement.

UPDATE students
SET classification = 'senior'
WHERE id_students = 1


That's more like it. This statement updates the classification of only one student. You can also update multiple columns with one query, as in the following:

UPDATE students
SET classification = 'freshman', tuition = 7500
WHERE id_students = 5


As you can see from the example, you can supply a list of fields to update with your UPDATE statement, and they will all be updated by the same query.

Deleting Records
The last SQL statement I'll discuss is the DELETE statement, which is similar to the UPDATE statement. It accepts a FROM clause, and optionally a WHERE clause. If you leave out the WHERE clause, it deletes all the records in the table. Here's an example:

DELETE FROM students
WHERE id_students = 1


You now know just enough about SQL to get into trouble! Actually, your newfound SQL knowledge will come in handy a bit later in the lesson when you develop an application that carefully extracts data from a database and encodes it in XML. But first, you find out how to export an entire database table as XML.


Sty - Knowledge is Free

Read More..

Introduction

The term Ajax is used to describe a set of technologies that allow browsers to provide users with a more natural browsing experience. Before Ajax, Web sites forced their users into the submit/wait/redisplay paradigm, where the user 's actions were always synchronized with the server 's "think time". Ajax provides the ability to communicate with the server asynchronously, thereby freeing the user experience from the request/response cycle. With Ajax, when a user clicks a button, you can use JavaScript and DHTML to immediately update the UI, and spawn an asynchronous request to the server to perform an update or query a database. When the request returns, you can then use JavaScript and CSS to update your UI accordingly without refreshing the entire page. Most importantly, users don't even know your code is communicating with the server: the Web site feels like it's instantly responding.

While the infrastructure needed by Ajax has been available for a while, it is only recently that the true power of asynchronous requests has been leveraged. The ability to have an extremely responsive Web site is exciting as it finally allows developers and designers to create "desktop-like" usability with the standard HTML/CSS/JavaScript stack.

Defining Ajax

Jesse James Garrett at Adaptive Path defined Ajax as follows:

Ajax isn't a technology. It's really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:

  • Standards-based presentation using XHTML and CSS
  • Dynamic display and interaction using the Document Object Model
  • Asynchronous server communication using XMLHttpRequest
  • JavaScript binding everything together

This is all fine and dandy, but why the name Ajax? Well, the term Ajax was coined by Jesse James Garrett, and as he puts it, it is "short-hand for Asynchronous JavaScript + XML."

How Does Ajax Work?

The kernel of Ajax is the XmlHttpRequest JavaScript object. This JavaScript object was originally introduced in Internet Explorer 5, and it is the enabling technology that allows asynchronous requests. In short, XmlHttpRequest lets you use JavaScript to make a request to the server and process the response without blocking the user.

By performing screen updates on the client, you have a great amount of flexibility when it comes to creating your Web site. Here are some ideas for what you can accomplish with Ajax:

  • Dynamically update the totals on your shopping cart without forcing the user to click Update and wait for the server to resend the entire page.
  • Increase site performance by reducing the amount of data downloaded from the server. For example, on Amazon's shopping cart page, when I update the quantity of an item in my basket, the entire page is reloaded, which forces 32K of data to be downloaded. If you use Ajax to calculate the new total, the server can respond with just the new total value, thereby reducing the required bandwidth 100 fold.
  • Eliminate page refreshes every time there is user input. For example, if the user clicks Next on a paginated list, Ajax allows you to just refresh the list with the server data, instead of redrawing the entire page.
  • Edit table data directly in place, without requiring the user to navigate to a new page to edit the data. With Ajax, when the user clicks Edit, you can redraw the static table into a table with editable contents. Once the user clicks Done, you can spawn an Ajax request to update the server, and redraw the table to have static, display-only data.

The possibilities are endless! Hopefully you are excited to get started developing your own Ajax-based site. Before we start, however, let's review an existing Web site that follows the old paradigm of submit/wait/redisplay and discuss how Ajax can improve the user's experience.

Sty - Knowledge is Free
Read More..

Before an application can read an XML document, it must learn what XML markup tags the document uses. It does this by reviewing the document type definition (DTD). A valid document includes a document type declaration that identifies the DTD the document satisfies. The DTD lists all the elements, attributes, and entities the document uses and the contexts in which it uses them.

Creating Your Own Markup Languages

When you create an XML document, you aren't really using XML to code the document. Instead, you are using a markup language that was created in XML. In other words, XML is used to create markup languages that are then used to create XML documents.

When you create your own markup language, you are basically establishing which elements (tags) and attributes are used to create documents in that language. Not only is it important to fully describe the different elements and attributes, but you must also describe how they relate to one another.

Creating Your First DTD

A DTD can be declared inline inside an XML document, or as an external reference.

Internal DTD Declaration

If the DTD is declared inside the XML file, it should be wrapped in a DOCTYPE definition with the following syntax:

<!DOCTYPE root-element [element-declarations]>

Example XML document with an internal DTD:

<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>

The DTD above is interpreted like this:

!DOCTYPE note defines that the root element of this document is note.
!ELEMENT note defines that the note element contains four elements: "to,from,heading,body".
!ELEMENT to defines the to element to be of the type "#PCDATA".
!ELEMENT from defines the from element to be of the type "#PCDATA".
!ELEMENT heading defines the heading element to be of the type "#PCDATA".
!ELEMENT body defines the body element to be of the type "#PCDATA".

External DTD Declaration

If the DTD is declared in an external file, it should be wrapped in a DOCTYPE definition with the following syntax:

<!DOCTYPE root-element SYSTEM "filename">

This is the same XML document as above, but with an external DTD (Open it, and select view source):

<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "note.dtd">
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

And this is the file "note.dtd" which contains the DTD:

<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>

As you know by now, the goal of most XML documents is to be valid. Document validity is extremely important because it guarantees that the data within a document conforms to a standard set of guidelines as laid out in a schema (DTD or XSD).

An XML application can certainly determine if a document is well formed without any other information, but it requires a schema in order to assess document validity. This schema typically comes in the form of a DTD (Document Type Definition) or XSD (XML Schema Definition), which you learned about in next article.

To recap, schemas allow you to establish the following ground rules that XML documents must adhere to in order to be considered valid:

- Establish the elements that can appear in an XML document, along with the attributes that can be used with each
- Determine whether an element is empty or contains content (text and/or child elements)
- Determine the number and sequence of child elements within an element
- Set the default value for attributes

Sty - Knowledge is Free

Read More..

Your Ad Here