-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJDBC.java
More file actions
82 lines (65 loc) · 2.33 KB
/
JDBC.java
File metadata and controls
82 lines (65 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.PreparedStatement;
/**
setenv CLASSPATH .\:/usr/share/java/mysql-connector-java.jar
Project: Municipal Library Management System
Stage: SPIKE - JDBC Implementation
Branch: Spike_1_JDBC
Description:
This spike focuses on exploring JDBC (Java Database Connectivity)
integration for the Municipal Library Management System.
It serves as an experimental setup to connect the system’s
backend logic with a relational database for managing book
and user records.
Goals for future refernce:
- Test and validate database connectivity using JDBC.
- Explore CRUD (Create, Read, Update, Delete) operations
for the Book and Library entities.
- Establish a reusable database utility framework
for future development integration.
Outcome:
As a result of this spike, the team gains a working
understanding of how to connect Java with a database,
execute SQL queries, and handle data persistence.
The outcome provides a baseline for future implementation
in the main branch.
------------------------------------------------------------
Refer to: spike_1_config.properties for detailed configuration.
*/
public class JDBC{
public static void main(String[] args){
try{
String url = "jdbc:mysql:Placeholder";
String user = "m4w79";
String pass = "*********";
Connection conn = DriverManager.getConnection(url, user, pass);
System.out.println("Connection Established!");
}
catch (SQLException e) {
System.out.println("\t<<<SQL Error>>> " + e.getMessage());
}
}
}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.PreparedStatement;
/**
setenv CLASSPATH .\:/usr/share/java/mysql-connector-java.jar
*/
public class JDBC{
public static void main(String[] args){
try{
String url = "jdbc:mysql:Placeholder";
String user = "m4w79";
String pass = "*********";
Connection conn = DriverManager.getConnection(url, user, pass);
System.out.println("Connection Established!");
}
catch (SQLException e) {
System.out.println("\t<<<SQL Error>>> " + e.getMessage());
}
}
}