avatar

Andres Jaimes

How to install postgres on FreeBSD

PostgreSQL, also known as Postgres, is a popular open-source relational database management system (RDBMS) that is widely used by developers and organizations around the world. FreeBSD, a free and open-source operating system, is well-known for its reliability, performance, and security features. In this blog post, we will guide you through the process of installing PostgreSQL in FreeBSD. Whether you’re a developer or a system administrator, this step-by-step tutorial will help you get started with it.

Enterprise Architect – Synchronize model from a live database

Synchronize a model from a live database to Enterprise Architect. Select your database from the Database Model folder in Project Browser. Go to Tools > Database Builder Right click on Tables > Show Differences. We can also click on a different type of object. a. An active connection is needed to complete the previous step. If no one exists Enterprise Architect will ask us to create one. The list of differences will show up on the Database Compare tab Select the ones you want to import or click the Set Import All button.

Read all tables and columns from a database using Java

This Java example finds all the tables and their corresponding columns from a database. The code iterates over the entities and columns found and shows them on the console. Minor changes are necessary to process the found values in a different way. Connection conn; DatabaseMetaData dmd; ResultSet rs1, rs2; ResultSetMetaData rsmd; Statement s; try { conn = getConnection(); dmd = conn.getMetaData(); rs1 = dmd.getTables("database_name", null, "%", null); s = conn.createStatement(); while (rs1.

Oracle Snippets

This post will be updated with snippets for Oracle. I hope you find it useful.  1. Change the default date format Most useful snippet of the year! 😉 ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY HH24:MI:SS'; select sysdate from dual; 2. Escape single quotes and ampersands on strings Single quotes: select 'D''Angelo''s' from dual; Ampersands: SET DEFINE OFF; 3. Adjust page width and size set pagesize 1000 set linesize 100 4.

Create a connection to MySQL in Java

This time we are going to create a basic connection to MySQL in Java and pull some data from it. // Compile it: // javac Mysql.java // // Try it: // java -classpath mysql-connector-java-5.1.27-bin.jar:. MySQL import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; public class MySQL { public Connection getConnection() throws SQLException { Connection conn = null; Properties p = new Properties(); p.put("user", "username"); p.put("password", "superpassword"); String cs = "jdbc:mysql://localhost/demo"; conn = DriverManager.

Installing the PHP/MongoDB extension on Mac OSX 10.8

Installing PHP/MongoDB extension is a two steps task on OSX: Install the autoconf tool required for compiling the extension Install the Mongo extension You have to install autoconf in order to avoid the following error: Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. ERROR: `phpize’ failed Enough talk, hands on work…  Step 1. Install the autoconf tool Download the latest source version:

1000 song names SQL test data

This time I want to share a 1000 rows SQL table that you can use for text searches. It includes a table with 1 column, 1000 rows song title names. It is plain standard SQL so you can use it with any database manager. Download it here. Hope you find it useful.

Exchange: The database files in this storage are inconsistent

This morning I got a new surprise from my Exchange server. Outlook clients could not connect to the servers, however the server seemed to be working pretty normal. After some research I found out the Exchange databases were corrupted. But, how did this happen? Well, they can get corrupted when Windows is not shutdown in a proper way, or a service or process misbehavior leaves them in an inconsistent state or when there are physical errors on your hard disk.