Browsed by
Category: Database

Connecting aws ec2 mysql from workbench

Connecting aws ec2 mysql from workbench

Hello all, After a lot of struggle I finally made connection to aws ec2 mysql from workbench, posting here to help you guys. Connecting aws ec2 mysql from workbench:     If you are getting any other exceptions then do validate the below steps once again,   Step 1: Creating root user with all the privileges: CREATE USER ‘root’@’18.188.178.178’ IDENTIFIED BY ‘root1’; GRANT ALL PRIVILEGES ON javadomain.* TO ‘root’@’18.188.178.178’; javadomain => database schema (which I created directly in linux mysql…

Read More Read More

206 total views, no views today

Oracle SQL & PL/SQL Quick Notes

Oracle SQL & PL/SQL Quick Notes

Hi Guys, We come across few queries in oracle and pl/sql on daily development tasks which we forget/wont remember correctly sometime. This post keeps track on those items. Keep visiting this post for the regular updates.   This can be used to refresh for your oracle and pl/sql interviews as well. Feel free to add your thoughts in the comments section to keep the post updated.   1. How to view the procedure full source code? Run the below query…

Read More Read More

621 total views, no views today

How to connect to CPanel Remote MySql in Java ?

How to connect to CPanel Remote MySql in Java ?

How to connect to CPanel Remote MySql in Java ? When you are having your code in local and you want to connect your remote mysql which is in your cpanel, then you need to follow below steps to connect to it.   Step 1: Login to CPanel and Navigate to Remote MySql   Login to cpanel and navigate to remote mysql which is under databases CPanel Login -> Databases -> Remote MySql -> Click     Step 2: Find…

Read More Read More

901 total views, no views today

MongoDB CRUD Commands for Beginners

MongoDB CRUD Commands for Beginners

If you are very new to MongoDB and do not have MongoDB installed in your machine, refer the below link to install mongodb on windows 7.   How to install mongodb on windows 7 ?   This is how data stores in MongoDB, Database -> collections -> Documents (structured and unstructured)   Where In RDBMS, Schema -> Database -> Tables -> Rows and columns. Variable “db” is the mongodb shell variable, it is set to the current database.   For…

Read More Read More

700 total views, no views today

How to connect MongoDB with Java ?

How to connect MongoDB with Java ?

How to connect MongoDB with Java ?: MongoDB is a document based open source data model. It stores the unstructured data’s in a JSON format. In our earlier posts we have seen how to install mongodb on windows 7 and resolved some of the most common issues while installing mongodb in windows 7.   How to install mongodb on windows 7 ?     Requirements: mongo-java-driver (3.4.1 is the latest version when I am writing this post.)     Creating…

Read More Read More

889 total views, no views today

How to install mongodb on windows 7 ?

How to install mongodb on windows 7 ?

How to install mongodb on windows 7 ? Step 1: Download the MongoDB for windows 7   Download MongoDB windows binary files from here, For windows 7, Mongodb for windows 7 [Download the zip version not msi] For windows 2008+ (for windows 10 as well) Mongodb for Windows 2008+ or windows 10 (Size is around 232MB)   Step 2: Extract the folder. Extract the above downloaded zip file to mongodb folder in C drive.     Step 3: Create the…

Read More Read More

1,509 total views, no views today

How to Insert Single and Double Quotes in Oracle?

How to Insert Single and Double Quotes in Oracle?

How to Insert Single and Double Quotes in Oracle? Inserting Single quote in oracle: If your query is like this, insert into emp (id,name,salary) values (10,’Naveen’s’,10000); // error then you will get the error for the single quote in the name. We have to escape it to insert in oracle using one more single quote like this, insert into emp (id,name,salary) values (10,’Naveen”s’,10000);   // it’s fine because we escaped single quote with one more single quote This will insert…

Read More Read More

695 total views, no views today

Autocomplete using jQuery, PHP and MySQL

Autocomplete using jQuery, PHP and MySQL

Autocomplete is a basic mandatory functionality in any web development. It will help user to find the correct item just with partial name/some letters of the item which they know about the item.     Import the below scripts and CSS’s: <script type=”text/javascript” src=”http://code.jquery.com/jquery-2.1.1.min.js”></script> <script type=”text/javascript” src=”//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js”></script> <script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jquery.ui/1.11.0/jquery-ui.min.js”></script> <link rel=”stylesheet” href=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css” type=”text/css” /> <link rel=”stylesheet” href=”//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css” type=”text/css” /> Note: Bootstrap.js and bootstrap.min.css imported for the better UI, you can remove it if you want only the autocomplete functionality….

Read More Read More

1,654 total views, no views today

Java With MySQL Select Example

Java With MySQL Select Example

Download the users_test table: Users_test table – Mysql download Loading the Mysql connection: public Connection LoadDriver() { Connection connection = null; try { // Driver Name String mySQLDriver = "org.gjt.mm.mysql.Driver"; // Path/database name [here guru is the database name] String url = "jdbc:mysql://localhost:3306/guru"; Class.forName(mySQLDriver); // User name and password connection = DriverManager.getConnection(url, "root", "pass123"); } catch (Exception exception) { System.err.println("Exception! "); System.err.println(exception.getMessage()); } return connection; } Fetching the records: [Select] public void getRecords(Connection connection) { String query = "SELECT *…

Read More Read More

844 total views, no views today

select with timestamp or date in oracle

select with timestamp or date in oracle

select with timestamp or date in oracle: If you want to select the date field or timestamp field with the given date, then you have to use the query like this, select * from TABLE_NAME where TO_CHAR(TIMESTAMP_OR_DATE_COLUMN,’DD-MM-YYYY’) =’25-02-2014′; Eg: select * from POST_SITE where TO_CHAR(POST_TMS,’DD-MM-YYYY’) =’25-02-2014′; here POST_SITE is the name of the table and POST_TMS is the name of the column which is either date field or timestamp field. Please add your comments in the below comment area… 687 total…

Read More Read More

687 total views, no views today