50% Off/-

50% Off/-

Php

50% Off/-

50% Off/-

Web

50% Off/-

50% Off/-

Latest Added Tutorials

We can Category Table CREATE TABLE category ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50) NULL, url VARCHAR(50) NULL, parent INT NULL, created_at TIMESTAMP NULL, updated_at TIMESTAMP NULL, deleted_at TIMESTAMP NULL, resim VARCHAR(255) NULL, kisaltma VARCHAR(255) NOT NULL, CONSTRAINT category_category_parent_fk FOREIGN KEY (parent) REFERENCES category (id) ON DELETE SET NULL ) ENGINE = InnoDB COLLATE = utf8_unicode_ci; CREATE INDEX category_category_parent_fk...Continue Reading
Event::listen('Illuminate\Database\Events\QueryExecuted', function ($query) { if (App::environment() == 'local') { Log::info($query->sql . ' Parameters: ' . serialize($query->bindings)); } });...Continue Reading
We can connect msql server as follows: $serverName = "127.0.0.1"; $uid = "sa"; $pwd = "123456!"; $databaseName = "TEST"; $connectionInfo = array("UID" => $uid, "PWD" => $pwd, "Database" => $databaseName, "CharacterSet" => "UTF-8"); //Connect using SQL Server Authentication. $conn = sqlsrv_connect($serverName, $connectionInfo); $tsql = "SELECT * FROM fatura"; // Execute the query. $stmt = sqlsrv_query($conn, $tsql); $row = sqlsrv_fetch_array($stmt); if (stmt) { echo "Statement executed"; } else { echo "Error in statement execut...Continue Reading
Question: 1. What is the reason for setting MappedBy in bidirectional many-to-many relationships? 2. When one table has significant amount of records, while other has a few, which side is better to put mappedBy Answer: It's actually a good question, and it helps to understand the concept of an "owning" entity. If you want to prevent both sides (in a bidirectional relationship) from having join tables, a good idea, then you need to have a mappedBy= element on one side. Whether or not there is a join table is controlled by the mappedBy="name" el...Continue Reading
1. First of all, create a new mysql user: mysql -u root -p create user 'olyanren'@'%' identified by '123456'; grant all priviliges on *.* to 'olyanren'@'%' with grant option; Note: Change olyanren username and password 123456. Also note that don't delete single quotas. The key point is wildcard (%). By using wildcard, we give olyanren user an access right to connect from any host. After these steps, confirm if the new user olyanren has been created select user, host from mysql.user; 2) Restart mysql service mysqld restart ...
OneToMany Unidirectional Mapping Question: In this document (scroll down to the Unidirectional section): http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/#entity-mapping-association-collections It says that a unidirectional one-to-many association with a join table is much preferred to just using a foreign key column in the owned entity. My question is, why is it much preferred? Answer 1: Consider the situation where the owned entity type can also be owned by another parent entity type. Do you put foreign key refere...Continue Reading
For most developers, writing almost the same code for every DAO in an application has become indespensible. To solve this problem and to rescue developers from copying and pasting same codes into every dao classes, we will use DAO pattern. In this tutorial, I will show you how to create dao pattern in a spring application. The foundation of using a Generic DAO is the CRUD operations that you can perform on each entity. Generic Dao Implementation Model Class Hibernate ORM framework uses model classes for database tables. Therefore we need to creat...Continue Reading
To set the default to UTF-8, you want to add the following to my.cnf or my.ini for Windows [mysqld] collation-server = utf8_unicode_ci character-set-server = utf8 If you want to change the character set for an existing DB, you can use following code: ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci; ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;...Continue Reading
To convert yyyymmddhhmmss string format to datetime in Microsoft Sql Server, you can use below sql script: update PageContent set NewDatetimeColumn = convert(datetime, stuff(stuff(stuff(OldDateAsStringColumn, 9, 0, ' '), 12, 0, ':'), 15, 0, ':')) NewDatetimeColumn column is defined in the PageContent table and will be used to store OldDateAsStringColumn's string value after conversion operation. After run this script, for example, 20090513024903 string value will be 2009-05-13 02:49:03.000...Continue Reading
If you want to change some string content of a column, you can use REPLACE function as follow: UPDATE urls SET url = REPLACE(url, 'domain1.com/images/', 'domain2.com/otherfolder/') urls: Table Name url: Column Name REPLACE function first parameter is column name, second parameter string value to be changed, and third parameter is new string value....Continue Reading
The transaction isolation levels in JDBC help us to determine whether the concurrently running transactions in a DB can affect each other or not. If there are 2 or more transactions concurrently accessing the same DataBase, then we need to prevent the actions of the transactions from interfering with each other. The above is achieved using the isolation levels in JDBC....Continue Reading
The addition of JDBC connection pooling to your application usually involves little or no code modification but can often provide significant benefits in terms of application performance, concurrency and scalability. Improvements such as these can become especially important when your application is tasked with servicing many concurrent users within the requirements of sub second response time. ...Continue Reading
With Hibernate JBoss Toolbar, we will execute reverse engineering to create Plain Old Java Classes(POJO), Dao classes and hbm.xml files from database tables. Thus, we can get rid of converting manually database tables into Java classes. This process is called as Reverse Engineering. Now lets start the process by using Eclipse Kepler and Hibernate Toolbar Plugin. ...Continue Reading
What is Hibernate Session? A Session is used to get a physical connection with a database. The Session object is lightweight and designed to be instantiated each time an interaction is needed with the database. Persistent objects are saved and retrieved through a Session object. The session objects should not be kept open for a long time......Continue Reading
When Microsoft SQL Server 2014 is setup, Reporting Services uses 80 port. To change this port, go to following directory: C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer then, open rsreportserver.config file with any text editor and replace......Continue Reading

© 2019 All rights reserved. Codesenior.COM