Connection Charset

In this chapter you will learn:

  1. Specify a CharSet when connecting to a DBMS

Set the charset through properties

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;
//from   j  av a2s  .  co m
public class Main {
  public static void main(String[] argv) throws Exception {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    Properties prop = new Properties();
    prop.put("charSet", "iso-8859-7"); 
    prop.put("user", "your username");
    prop.put("password", "your password");

    // Connect to the database
    Connection con = DriverManager.getConnection("url", prop);

  }
}

Next chapter...

What you will learn in the next chapter:

  1. How to work with ODBC through JDBC
Home » Java Tutorial » Driver and Connection

Introduction

    JDBC

Driver

    Driver
    Driver Loaded
    Login Timeout
    Driver Available Parameters
    Driver version
    JDBC logging

Connection

    Connection
    Connection Properties
    Connection Charset
    JDBC ODBC Bridge
    HSQL memory based database

Database Meta Data

    All key words
    Table schema
    Table catalog
    Database version
    Database product version and name
    Data type information
    Transaction level
    Connection User name, URL and driver version
    All table names
    Get all column names
    Table existance
    System Functions Supported
    Date time function
    Numeric Functions Supported
    String functions
    Feature support
    Connection Limit
    Support Scrollable ResultSet