For Database Administrators and Developers, this is a common practice. Sometimes we would love to track who has accessed a particular record from the users’ perspective based on ID and time. The usage of TIMESTAMP would be the best way.
Been playing around with Hibernate and mapping classes with Java. A reason why Hibernate is useful is so to facilitate users to stop writing pure SQL for queries and reduce code redundancy. A slight note, Hibernate also works well with the .NET platform.
Though there was this error which TechieDan experienced
org.springframework.orm.hibernate3.HibernateSystemException: [...]
a programmer uses PreparedStatement instead of Statement when doing SQL queries in my projects. I found out that I can indelibly hacked into the system when I use SQL injection
For those Java like programmers, they will be using pure SQL statements to get the whole of a table by typing the typical SQL query statement.
String SQL = “select * from tablename where condition = ?”;
From then onwards it can be passed to a POJO to be declared but everything has to be done one [...]
Coding have never been the same!!! Some bad habits when writing codes which are redundant
String[] special = {“a1″,”a2″,”a3″,”a4″};
Connection con = null;
PreparedStatement stmt = null;
PreparedStatement stmt2 = null;
ResultSet rs = null;
ResultSet rs2 = null;
Class.forName (“com.mysql.jdbc.Driver”)
conn = DriverManager.getConnection (url, userName, password);
String [...]
mySQL and msSQL has a similar SQL syntax but not the same. To have a grasp of what does this mean, let’s have an exercise to get 10 rows from a table with mySQL.
select * from [tablename] limit 10
Now if you were to run this sql query above on msSQL server you’ll either get a wrong sql [...]