Monday, May 30, 2011

DETTACH / attach in SQL SERVER 2000

| Monday, May 30, 2011 | 0 comments

DETTACH / attach in SQL SERVER 2000
You probably have done a copy of the database to other location by using a database backup Either attach or detach the database operation. Do you know what precisely Happen behind detach the database under the hood?
Detach the database Could Be done only if the database is not being accessed by anyone. If you Would like to make sure none accesses the database, you cans set the database to sql SINGLE_USER in ALTER DATABASE command with one of the termination options: WITH ROLLBACK AFTER n SECONDS WITH ROLLBACK IMMEDIATE or (Where n is a any integer number), for example:
ALTER DATABASE AdventureWorks2008
SET SINGLE_USER
WITH ROLLBACK AFTER 3 SECONDS
After That you cans sp_detach_db <databasename> issue (for example: EXEC sp_detach_db AdventureWorks2008).
Interesting thing to note Is That Pls detach a database is Issued, SQL Server will of copy dirty pages (pages changes since last checkpoint) back to corresponding pages in database files. You just only need to copy / move files into other database location for attaching the SQL Server database and transaction log files Could rebuild for you. But there are two conditions database That you need to be aware about.
If the database is read only, you need to include not only data files but Also Pls attach the transaction log file database. If the database is read write, you need only to include data files.
Since SQL Server 2005, the syntax for attach database is CREATE DATABASE ON <filespec> <database name> [, .... N] FOR {attach | ATTACH_REBUILD_LOG}. The legacy command sp_attach_db Should not be Used Because it Becomes depreciated features and Could Be removed in future SQL Server releases. The difference Between the new syntax and legacy Is That the maximum number of files on legacy is up to 16 files on the new syntax whereas the maximum number of files That Could be attached is up to 32.767 32.767 files and file groups. Certainly you will from never reach the number of files That need to be attached.
To me, attach-detach is as good as a backup-restore the database. The only difference Between Them Is That database is still accessible During the backup-restore whereas attach-detach requires a database to be offline.
** If my friends do not know what it means can translate on google
Bottom line:
DETTACH / Attach
Function: copying files to a server database and SQL Server menginisilisasi
How to Attach:
From Interprise Manager
Database
Right Click - All Task - Attach
Find the file *. MDF
How Dettach:
From Interprise Manager
Click on a database which is
Right click

Readmore..

learning Data Manipulation Language (DML)

| | 0 comments

Data Manipulation Language (DML)
ADD DATA


INSERT INTO table_name
VALUES (value_1, value_2 ,..., nilai_n)


OR


INSERT INTO table_name (kolom_1, kolom_2 ,..., Kolom_n)
VALUES (value_1, value_2 ,..., nilai_n);
NOTE


Fields with are mandatory NOT NULL konstraint
Writing data to the type of numbers are not enclosed in quotation marks
Writing data to the type of string or a date enclosed in quotation marks
Data on the child table (foreign key) must exist in the parent
EXAMPLE
INSERT INTO STUDENT VALUES (2001, 1, 'ANITA', 'MAGELANG', '1-JAN-85 ');
INSERT INTO STUDENTS (Thang, NIM, NAME) VALUES (2005, 9, 'David');


CHANGE DATA


UPDATE table_name
SET
kolom_1 = nilai_baru_1,
kolom_2 = nilai_baru_2,
...
kolom_3 = nilai_baru_n
[WHERE condition]
Change all the rows, one column
Change all thmasuk to 2003
UPDATE students
SET thmasuk = 2003;
Changing a particular column for a particular row
change the column name to Marani Anita in the table of his students who NIM = 200
UPDATE students
SET name = 'Anita Marani'
WHERE NIM = 200;
Change multiple columns at once
UPDATE Student
SET
name = 'Anita Mariana',
thmasuk = 2000
WHERE NIM = 200;
Operator Condition
Relational Operators (=,>, <,> =, <=, <>)
Boolean Operators (And, Or, Not)
UPDATE class
SET NIP = 1
WHERE CODE = 'P1'
AND NIP = 2
Between and Not Between
UPDATE class
SET NIP = 1
WHERE idkelas BETWEEN 1 AND 3
Operator Conditions (Cont ...)
In and Not In
UPDATE class
SET NIP = 1
Idkelas WHERE IN (1,2,3)
Is Null and Is Not Null
UPDATE Student
SET DATE = '21-Aug-89 '
WHERE date IS NULL
Like and Not Like
Wildcard
%  some arbitrary character
_  one arbitrary character
[]  any one character in the range
[^]  any single character outside the range


Sample Data: Erike, Mirna, Ani, Kaka, Ubaid
LIKE '% a': Mirna, Kaka
LIKE '% a%': Mirna, Kaka, Ubaid
LIKE '_a%': Kaka
LIKE '% [a-k] a%': Kaka
LIKE '% [^ a-k] a%': Mirna


Example Queries:


UPDATE Student
SET
Address = Null
WHERE Name LIKE '% a%';

Readmore..

Thursday, May 26, 2011

Java scripts and Java differences

| Thursday, May 26, 2011 | 3 comments

Java scripts and Java differences
First in Class X EMP B (Programs and Classes), Most Hated Banget with that name there are 2 JAVA Karna he thought of Master Patterns Differ in Teaching Us, And We Also confused with Javascript on the Web!
So What is actually "Differences Between Java and Java Script ..?", if both are indeed derived from" Java "...!!. Ga At first I also know what is actually "Differences Between Java Script with Java", due to curious to know eventually I try to ask the same oom Google with the Keyword "The difference with Java Java Script" and after I had been looking for finally met as well. nah these results I found:
1.
Javascript is usually in its use combined with HTML, the aim is to enrich the HTML to get more interactive, java script therefore depend strongly on the browser used. If your browser does not mengijikan (disable) to use a javascript feed applications that use javascript are not the maximum, even could have been an error. Java is a language pemogramam object-oriented programming (OOP) in which applications can be made directly in the execution, of course by doing the compiler first. Language similar to java. Net was Microsoft, but java is open, in contrast with. Net is its use requires a license.
2.
JavaSript just a scripting language, whereas Java programming language that is multifunctional and platform independent. Java can be used to create desktop applications and also server (SDK and EE) is also for programming the mobile (ME), while JavaSript based on client-side can only dijalakan with the browser and executed on the client computer.
In addition, Java can also be used to create desktop applications that run in the browser by using the applet, while JavaScript can only work when combined with HTML.
3.
JavaScript is a script (text) which is read by the browser, then translated into a set of commands. Then the order was executed in the browser. JavaScript (generally) Dlm pasted HTML. Java is a program which generated (compiled) on the server, then run in a browser (if she Java Applet) or run on the server (if he's Java Server Pages).New results are displayed in the browser. Java programs must be retrieved from the server.
So the main difference between Jaca Script with Java is the way a program is executed. With its own java can penggunakaannya broader, JME -> for application development on mobile phones, JDK -> application development on desktops and Jee -> for the development of large applications (enterprise)
How? Are Useful For pal? Easy - Helpful hope ya friend!

Readmore..

CONNECTION TO DATABASE, metadata

| | 0 comments

CONNECTION TO DATABASE, metadata
Project for which we can make to a high with the database we have, then we have toconnect your database with an existing project.
Process connection:
a. Registration drivers
b. Connection to the database
c. Both must exist in the instruction block try {} catch (Exception) {}
Class / Interface in use:
Class Class
Method:
static Class forName (String namaclass) à Driver Registration class
Ex:
Class c = Class.forName ("com.jdbc.mysql.Driver");
All classes used for database management, is in the package java.sql .*
Class DriverManager
Method:
Connection getConnection (String location, String username, String pwd)
Ex:
String location = "jdbc: mysql: / / localhost / nama_db";
String uname = "username";
String pwd = "password";
Connection con = DriverManager.getConnection (location, uname, pwd);
À Connection Interface
Exception:
È Class ClassNotFoundException Exception will occur if there is an error registrationclass,
use forName method of class Class.
Class SQLExceptionèException to know the error connection and access the database / table.
Example 1
Create a new project, add the object form with the draft as follows:

CONNECTION TO DATABASE, metadata

In the TEST CONNECTION button to add the following code:

CONNECTION TO DATABASE, metadata

Adding libraries to the project in a way MYSQL, right-click Libraries choose AddLibrary

CONNECTION TO DATABASE, metadata

Selection dialog will appear as follows:

CONNECTION TO DATABASE, metadata

Select the MySQL JDBC Driver, and click the Add Library.
Run.
Example 2.
If the project that we make involve many forms, and each form must connect to the database, it would be better if the connection is made ​​in a separate class so that wedo not need to write the connection process again and again.
Create a project, add the Form as in Example 1 as follows:

KONEKSI KE DATABASE, METADATA

In this project also add an object class (Select the Java Class, not the Java Form), andcreate a constructor in class for the connection process as follows:

KONEKSI KE DATABASE, METADATA

In the form that had previously designed to add the following event CONNECTIONTEST button, and run.

KONEKSI KE DATABASE, METADATA

Example 3
Process connection can also be placed in a different package with the form.
Create a new project, add a form similar to Example 1 and Example 2 earlier.

KONEKSI KE DATABASE, METADATA

At the Source Package, Right-click the package name is the same with your project,select New à Java Package

KONEKSI KE DATABASE, METADATA

Dialog will appear to fill in the name of the package. Replace newpackage with data.Click the Finish button.

KONEKSI KE DATABASE, METADATA

Will form a new package by name tigakoneksi.data can be seen as follows:

KONEKSI KE DATABASE, METADATA

Right-click the new package, add a Java Class object, write the following code:

KONEKSI KE DATABASE, METADATA

In draft form, add the following event for the button CONNECTION TEST 2:

KONEKSI KE DATABASE, METADATA

If the error sign appears, right click on the lines of program code, select Fix Imports.Will automatically add the name of a new package that we have the following:

KONEKSI KE DATABASE, METADATA

Run.
Metadata DATABASE
Metadata à data about data
Interface used:
Interface Connection
Method:
Statement createStatement ()
à create a Statement object (interface Statement) to send commands to the database query
DatabaseMetaData getMetaData ()
à get the metadata that is stored to the object DatabaseMetaData (DatabasemetaData interface) from an existing database on the Connection object.
DatabaseMetaData Interface
Method:
GetTables ResultSet (String catalog, String schema, String tablename, String [] type)
à find out information from the database tables that exist in the metadata
DatabaseMetaData.
GetColumns ResultSet (String catalog, String schema, String tablename, String nmcolumn)
à know the names of a table from the database field whose metadata is in
DatabaseMetaData.
ResultSet Interface
Method:
String getString (String nmcolumn)
à take the value of the designated column from a ResultSet
Metadata from a database:
1. Get metadata from the connection and save it to DatabaseMetaData
DatabaseMetaData dbmd = con.getMetaData ();
2. Get information from databasemetadata table with the function and save it to a ResultSet getTables
String [] type = {"TABLE"};
ResultSet rs = dbmd.getTables (null, null, null, type);
3. Show information of each table with a loop (rs.next ()) as follows:
a. Find the name of table
String nm_tbl = rs.getString ("TABLE_NAME");
b. Find a table structure
rs1 = dbmd.getColumns (null, null, nm_tbl, null);
c. Show the structure of each table with a loop (rs1.next ()) as follows:
String nm_field = rs1.getString ("COLUMN_NAME");
String tp_field = rs1.getString ("TYPE_NAME");
String lb_field = rs1.getString ("COLUMN_SIZE");
Examples
Displays the name of all tables in the database.
Create a new project, add the object form with the draft as follows:

KONEKSI KE DATABASE, METADATA

In the model properties (JTable) turned into a Custom Code.
Add a new package, in this package add the Java Class object, write code to connect to the database.
Write the following instructions are also on the source form above.

KONEKSI KE DATABASE, METADATA

Run, will be obtained as follows:

CONNECTION TO DATABASE, metadata

Metadata from a ResultSet
Interface is involved:
Interface Statement
Method:
ResultSet executeQuery (String sql)
à execution that produces a ResultSet query (Query SELECT)
ResultSet Interface
Method:
ResultSetMetaData getMetaData ()
à get the ResultSet metadata.
Interface ResultSetMetaData
Method:
getColumnCount int ()
à get the number of columns of a ResultSet
String getTableName (int i)
àmendapatkan table name
String getColumnName (int i)
à get the column names to i
String getColumnTypeName (int i)
à get the column type to i
Steps to get the metadata ResultSet:
1. Make a Statement
Statement STT = con.createStatement ();
2. Get the ResultSet (query execution)
String sql = "Select * from nm_tbl";
ResultSet rs = stt.executeQuery (sql);
3. Get metadata
ResultSetMetaData RSMD = rs.getMetaData ();
4. Get number of columns
int j = rsmd.getColumnCount ();
5. Get table name
String nm_tbl = rsmd.getTableName (index);
6. Get field names and types, with a looping
for (int i = 1; i <= j; i + +)
String nm_field = rsmd.getColumnName (i);
String tp_field = rsmd.getColumnTypeName (i);
Examples
On an existing project, add a form with the draft as follows:

CONNECTION TO DATABASE, metadata

At The OK button, enter the following code

CONNECTION TO DATABASE, metadata

Run, will be obtained as follows:

CONNECTION TO DATABASE, metadata

 

end

Readmore..

Thursday, May 19, 2011

What is "JAVA"?

| Thursday, May 19, 2011 | 0 comments

Among the many existing software, we often hear the term Java, called Java or J2ME (Java 2 Micro Edition), which is derived from the Java language, where its functions focused on making applications to the mobile environment.
Java is a software technology that in it includes a programming language. In addition, Java also is a platform that has a virtual machine and libraries needed to write and run a program.
Java Initially developed in the computer environment by Sun Microsystems Inc. with the aim to produce a simple computer language without having attached to a specific architecture.
In 1995 Sun released a Java-based browser with the nickname of Hot Java, and subsequently decided to make Netscape's browser equipped with Java language.
Afterwards, join them too many reputable developers IBM and Microsoft.
The following year, Sun Microsystems Inc.. release of the Java Software Development Kit (JDK) first, which is JDK 1.1. Then continue to develop the programming that runs the applet in the browser into a world-class programming that is widely used for the development of a variety of applications.
The Java programming language itself broadly grouped into 3, namely Java 2 Standard Edition (J2SE), Java 2 Enterprise Edition (J2EE) and Java 2 Micro Edition (J2ME).
J2SE is used to develop desktop applications and applets.
J2EE is used to develop applications based on client / server enterprise scale.
And J2ME applied to a variety of small devices with the amount of memory, storage capacity and limited user interface, such as mobile phones and PDAs.
Until now there are two versions of the Java J2ME platform which is commonly used in the MIDP 1.0 mobile phones that still have a simple specification and provide basic functionality for mobile applications, including basic user interface and network security. And MIDP 2.0 which has added a variety of facilities such as gaming, multimedia, support various types of connectivity, as well as OTA.
Excerpted from various sources.
by www.zahroel.co.cc

Readmore..

Wednesday, May 11, 2011

Creating a blog using CSS menus

| Wednesday, May 11, 2011 | 0 comments

CSS

Before there is such thing as CSS code, the navigation menu created by using tables with HTML code. Whether it be horizontal or vertical menu. In fact, to make a website layout still use tables. Well ... if you've no time now to make a navigation menu with table had no other way is by using CSS code. Here's the ropes and hopefully can be understood .........
Creating a blog using CSS menus
Before starting, please note that in order to place the CSS code in a blog that is must be between <head> tag and </ head>. Or to be more easily, keep the above code
]]></ B: skin>
</ Head>
Ok .... immediately wrote to how to create CSS code for menu navigation.
First you must create a first code tag css for the navigation menu settings. See the code below:
# Menu
{
margin-bottom: 10px;
height: 29px;
background: transparent;
padding: 0px 0;
}
Then, create a CSS code to change the default format for ul and li tags
# Menu ul
{
margin: 0;
padding: 7px;
height: 29px;
text-align: center;
}
# Menu ul li
{
list-style: none;
display: inline;
}
The purpose of the CSS code above is to change the format tag ul from vertical to horizontal and set the margin and padding for each menu navigation. Next, make a CSS code to create a variety of links from the navigation menu. code:
# Menu ul li a: link, # menu ul li a: active, # menu ul li a: visited
{
color: white;
margin-bottom: 4px;
padding: 13px 13px 7px 7px;
font-size: 1em;
font-family: 'lucida grande', arial, sans-serif;
font-weight: bold;
text-decoration: yes;
background: url (http://i283.photobucket.com/albums/kk315/
meezanx_2008/menu.gif) repeat-x;
background-position: center;
}
# Menu ul li a: hover
{
color: white;
}
Well ..... the above code is a tutorial that all CSS code mebuat navigation menu. For more details and how to save tersbut code in your blog template follow these steps:
* Log in to Blogger and then select and edit the HTML layout
* For security please download your template first
* Remember .... Do not give a checklist on the box Expand Widget Templates.
* Find the following code:
]]></ B: skin>
</ Head>
* If you have found. please copy and paste the following code above the HTML code earlier
# Menu
{
margin-bottom: 10px;
height: 29px;
background: transparent;
padding: 0px 0;
}
# Menu ul
{
margin: 0;
padding: 7px;
height: 29px;
text-align: center;
}
# Menu ul li
{
list-style: none;
display: inline;
}
# Menu ul li a: link, # menu ul li a: active, # menu ul li a: visited
{
color: white;
margin-bottom: 4px;
padding: 13px 13px 7px 7px;
font-size: 1em;
font-family: 'lucida grande', arial, sans-serif;
font-weight: bold;
text-decoration: yes;
background:
url (http://i283.photobucket.com/albums/kk315/meezanx_2008/menu.gif)
repeat-x;
background-position: center;
}
# Menu ul li a: hover
{
color: white;
}
* After finishing his copy and paste, locate the following code:
<div id='content-wrapper''>
* If you have found (have to) copy the following code above the html code
<! - START MENU ->
<div id='menu'>
<div style='display:none;'>
<img alt='preload' src='menuon.png'/>
</ Div>
<ul>
<li> <a href='URL ANDA' target='_blank"> Your Text </ a> </ li>
<li> <a href='URL ANDA' target='_blank"> Your Text </ a> </ li>
<li> <a href='URL ANDA' target='_blank"> Your Text </ a> </ li>
<li> <a href='URL ANDA' target='_blank"> Your Text </ a> </ li>
</ Ul>
</ Div>
<! - END MENU ->
Important Note:
1. CHANGE YOUR URL to link your purpose and your Text with the name of each - each link. See How to Make Link.
2. If you understand the CSS code, CSS code you can replace him, according to your needs.
If it is completed, save the template.

Readmore..

Saturday, May 7, 2011

make a list and add to the

| Saturday, May 7, 2011 | 0 comments

want to make like this? list, add, series, send, clear, sum, sequence, etclist, add

 

Readmore..

Friday, May 6, 2011

CSS (CASCADING STYLE SHEET)

| Friday, May 6, 2011 | 0 comments

css

1. Introduction to CSS
Cascading Style Sheets is a technology used to beautify
website page views (the site). With the overall color and CSS Method
display in a web site can be converted / reformatted quickly. CSS also
been in standartkan by the World Wide Web Consortium (W3C) for use on the web
browser.

Writing CSS
<style Type="text/css">
... CSS ...
</ STYLE>


Example:
<h1 style="color:red;"> Red, hahaha ...</ h1>


2. The terms in the Style Sheet
Style rules
Cascading style sheets is a collection of rules that define
style from the document. As an example we can create the style rules
determine that all <H2> display with the color orange.
Style sheets
Style sheets can be embedded into HTML document. Or called
embedded style sheet. Style sheets can also be made as an external file
and the link to an HTML document. Style roles can be wearing on the
of a certain web page. For example you can determine
certain paragraphs in the show with bold and italic style while
others remain as usual.
Selector
property1 {selector: value, property2: value,. . .}
h1 {color: green; background-color: orange;}

Style sheets consist of two parts:
1. Selector
The first part before the "{}" is called selector
2. Declaration
Consisting of the property and its value.
3. Use the style element
Let's start by setting the font color and background. You
can do this by using the style element to
set the character code tags of your document.
a. Inheritance (Inheritance):

Readmore..

Thursday, May 5, 2011

Change Title Case Using String Functions Being Ucwords

| Thursday, May 5, 2011 | 0 comments

there any php functions that are used to convert a string into upper case, lower case or title case. For this time I just want to discuss ucwords function. Ucwords function is a function that is used to change the characters of a string to title case form

Syntax of function ucwords:
$ output = ucwords ($ change);
variable $ output is a place used for storing strings that have been dibuah by ucwords function.
The variable $ change is a string that want dichange into title case.
Source code (save it as ucwords.php):

Readmore..

Monday, May 2, 2011

DATABASE BASIC CONCEPTS

| Monday, May 2, 2011 | 0 comments

 basis data, database, basicdo not know about databases? basik data is used to make the program. database is very closely related to sql. BACKGROUND Database processing into the mainstay and its presence is required by the various institutions and companies In developing the required database information system as data storage media The presence of the database can improve company performance and to improve the competitiveness of the company The database can speed up efforts to customer service to produce information quickly and accurately help decision makers to quickly decide an issue based on existing information

Readmore..

Popular Posts

 

Total Pageviews

stat

© Copyright 2010. http://programminghaha.blogspot.com . All rights reserved | http://programminghaha.blogspot.com is proudly powered by Blogger.com | Template by o-om.com - zoomtemplate.com