c****g 发帖数: 7 | 1 I install oracle8i personal edition and java one
the same machine.
How to set the url?
getConnection ("jdbc:oracle:thin:@"+ database,
------------what should be here? local
machine
"scott", "tiger");
JDBC 新手. Thanks a lot! | z***h 发帖数: 7 | 2 create a table login then try this code:
import java.sql.*;
import java.io.*;
public class JdbcTest
{
public static void main(String args[])
{
//String update = "INSERT INTO login(user_name, password,
user_type) VALUES ('Guest', '143456', 'adminis')";
String query = "SELECT * FROM login";
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "jdbc:odbc:ORACLE";
String username = "scott";
String password = "tiger";
try {
// Load the driver to allow connection to the database
Class.forName(
【在 c****g 的大作中提到】 : I install oracle8i personal edition and java one : the same machine. : How to set the url? : getConnection ("jdbc:oracle:thin:@"+ database, : ------------what should be here? local : machine : : "scott", "tiger"); : JDBC 新手. Thanks a lot!
|
|