Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:38:50+00:00 2026-06-08T03:38:50+00:00

I have the following JDBC connection with mysql database : import java.sql.*; public class

  • 0

I have the following JDBC connection with mysql database :

import java.sql.*;

public class Main
{
    public static void main (String[] args) throws ClassNotFoundException, SQLException
    {

        Class.forName("com.mysql.jdbc.Driver");

        String string = "jdbc:mysql://localhost:3306/testdb";

        Connection con = DriverManager.getConnection(string , "root2" , "root");
        PreparedStatement statement = con.prepareStatement("select * from names"); // SELECT * FROM `names`
        ResultSet result = statement.executeQuery();
        while (result.next())
        {
            System.out.println(result.getString(1) + " " + result.getString(2));
        }


    }
}

When I go into http://localhost/phpmyadmin and create a database , I can run successfully queries on the database the I made there , but how can I do that from inside Eclipse (e.g java) ?

To be more clear, the user enters data into a jsp page , and I extract the data
from there . After that , I want to create a database from inside Eclipse , without going directly into http://localhost/phpmyadmin . How can I do that ?

EDIT:

I have the needed servlets , what I want now is to create the database from the servlet and run the queries from the servlet .

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:38:52+00:00Added an answer on June 8, 2026 at 3:38 am

    Complete answer to your question will require a lot of writing and few clarifications.

    There is excellent tutorial which you can use:
    Creating Database Web Applications with Eclipse

    Instead of Derby DB you will use MySQL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the following code: `package com.tom.jam; //import java.sql.Connection; //import java.sql.DriverManager; import java.sql.*; import
I have a java code and I am connecting to the mysql database with
I've been trying to obtain the Driver class for JDBC connection to MySQL. The
How to access the another system mysql database through java program?Am using the following
I have the following entity class (in Groovy): import javax.persistence.Entity import javax.persistence.Id import javax.persistence.GeneratedValue
I have used the following code to connect between java and mysql, but it
I am trying jdbc connection with mysql but getting SQLException. My code is:-- public
I have a property file with the following junit.version=3.8.1 dbcp.version=5.5.27 oracle.jdbc.version=10.2.0.2.0 I try to
I have following plist: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
So I want to create a JDBC connection to MySQL server that is installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.