added 19 and 20
This commit is contained in:
11
Eclipse-Workspace/prg2_b2_38/.classpath
Normal file
11
Eclipse-Workspace/prg2_b2_38/.classpath
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Admin/Downloads/mysql-connector-j-9.6.0/mysql-connector-j-9.6.0/mysql-connector-j-9.6.0.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
1
Eclipse-Workspace/prg2_b2_38/.gitignore
vendored
Normal file
1
Eclipse-Workspace/prg2_b2_38/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/bin/
|
||||
17
Eclipse-Workspace/prg2_b2_38/.project
Normal file
17
Eclipse-Workspace/prg2_b2_38/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>prg2_b2_38</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -0,0 +1,11 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=21
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=21
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
25
Eclipse-Workspace/prg2_b2_38/src/in/test/insertdemo.java
Normal file
25
Eclipse-Workspace/prg2_b2_38/src/in/test/insertdemo.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package in.test;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
|
||||
public class insertdemo {
|
||||
public static void main(String[] args) throws Exception{
|
||||
Class.forName("com.mysql.cj.jdbc.Driver");
|
||||
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jdbc_B2_38", "root", "12345");
|
||||
PreparedStatement ps = con.prepareStatement("insert into student (Rollno, Name, Marks) value (?, ?, ?)");
|
||||
ps.setInt(1, 104);
|
||||
ps.setString(2, "Anil");
|
||||
ps.setInt(3, 67);
|
||||
int i = ps.executeUpdate();
|
||||
if(i>0) {
|
||||
System.out.println("success");
|
||||
}
|
||||
else {
|
||||
System.out.println("fail");
|
||||
}
|
||||
con.close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user